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.
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
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
I had the same issue, this is how resolved it [NOTE: I am using ubuntu, so at "g++" you have to use "gcc" if you are using any other OS]:
At first I cloned the repository to my local machine, and did some changes, have a look at the procedure below:
git clone git://github.com/eventmachine/eventmachine.git
cd eventmachine
gem install rake-compiler
rake-compiler cross-ruby VERSION=x.x.x-px
At the place of x.x.x-px you have to use your ruby version. see the list of available version of ruby which are compatible with rake-compiler here
Then go and put this: CONFIG['CXX'] = "g++"
in /eventmachine/ext/extconf.rb and /eventmachine/ext/fastfilereader/extconf.rb files, right below require 'mkmf'
line.
then do: rake gem
and after that: rake gem:install
It worked for me, hope it works for you too.
I'm using Ubuntu 16.10 sudo apt-get install ruby-dev build-essential
then sudo gem install eventmachine
. That solved it for me.
from docs .
EventMachine may require the following dependencies, depending on your specific usage:
* OpenSSL * libstd++ (some systems, such as debian, may require an explicit
install in order for the compiler to support this)
Try to install it , if you are using debian
sudo apt-get install libstdc++6
Remember to run rvm requirements and follow the instructions in Additional Dependencies.
For all users running openSUSE you'll need to execute this command :
zypper in -t pattern devel_C_C++
For simplicity we can say that this is the equivalent of this command under Ubuntu :
sudo apt-get install build-essential
精彩评论