Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to install "gem install eventmachine". I need starling in my project, for starling i need to install eventmachine

I am getting the following error on my console

root@comp09:~# gem install eventmachine
Building native extensions.  This could take a while...
ERROR:  Error installing eventmachine:
 ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... yes
checking for rb_thread_blocking_region()... no
checking for inotify_init() in sys/inotify.h... yes
checking for writev() in sys/uio.h... yes
checking for rb_thread_check_ints()... no
checking for rb_time_new()... yes
checking for sys/event.h... no
checking for epoll_create() in sys/epoll.h... yes
creating Makefile

make
I. -I/usr/local/lib/ruby/1.8/x86_64-linux -I/usr/local/lib/ruby/1.8/x86_64-linux -I. -DBUILD_FOR_RUBY -DHAVE_RB_TRAP_IMMEDIATE -DHAVE_RBTRAP -DHAVE_INOTIFY_INIT -DHAVE_INOTIFY -DHAVE_WRITEV -DHAVE_WRITEV -DHAVE_RB_TIME_NEW -DOS_UNIX -DHAVE_EPOLL_CREATE -DHAVE_EPOLL -DWITH_SSL    -fPIC -O2 -g -Wall -Wno-parentheses -Wno-long-long     -o rubymain.o -c rubymain.cpp
make: I.: Command not found
make: [rubymain.o] Error 127 (ignored)
I. -I/usr/local/lib/ruby/1.8/x86_64-linux -I/usr/local/lib/ruby/1.8/x86_64-linux -I. -DBUILD_FOR_RUBY -DHAVE_RB_TRAP_IMMEDIATE -DHAVE_RBTRAP -DHAVE_INOTIFY_INIT -DHAVE_INOTIFY -DHAVE_WRITEV -DHAVE_WRITEV -DHAVE_RB_TIME_NEW -DOS_UNIX -DHAVE_EPOLL_CREATE -DHAVE_EPOLL -DWITH_SSL    -fPIC -O2 -g -Wall -Wno-parentheses -Wno-long-long     -o em.o -c em.cpp
make: I.: Command not found

For any help and suggestion it would be greatly appreciated.

like image 382
Mukesh Singh Rathaur Avatar asked Jan 19 '11 12:01

Mukesh Singh Rathaur


2 Answers

I had a similar issue on Ubuntu 11.10 installing eventmachine.
The difference being (near the end of the logs)

make: g++: Command not found

instead of

make: I.: Command not found

This issue is related with C++ on GCC and resolved by installing build-essential

sudo apt-get install build-essential 
like image 144
Dimitris Baltas Avatar answered Oct 01 '22 20:10

Dimitris Baltas


You may also be missing the ruby dev packages. Depending on what version of ruby you are using, this could be ruby-dev, ruby1.8-dev, ruby1.9-dev, or ruby1.9.1-dev. I had the same problem, and installed ruby1.9-dev and ruby1.9.1-dev and that solved my issue.

This is the site that led me to try this approach: http://ruby.about.com/od/faqs/qt/Extconf-Rb-1-In-Require-No-Such-File-To-Load-Mkmf-Loaderror.htm

like image 40
Raj Avatar answered Oct 01 '22 21:10

Raj