无法安装“gem install eventmachine”。 我需要在我的项目中使用starling,因为我需要安装eventmachine

我在我的控制台上收到以下错误

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 

如有任何帮助和建议,将不胜感激。

我在Ubuntu 11.10安装eventmachine时遇到了类似的问题。
区别在于(接近日志结尾)

 make: g++: Command not found 

代替

 make: I.: Command not found 

此问题与GCC上的C ++有关,并通过安装build-essential解决

 sudo apt-get install build-essential 

您可能还缺少ruby开发包。 根据您使用的ruby版本,可能是ruby-dev,ruby1.8-dev,ruby1.9-dev或ruby1.9.1-dev。 我有同样的问题,并安装了ruby1.9-dev和ruby1.9.1-dev,这解决了我的问题。

这个网站让我尝试这种方法: http : //ruby.about.com/od/faqs/qt/Extconf-Rb-1-In-Require-No-Such-File-To-Load-Mkmf- Loaderror.htm

我有同样的问题,这是如何解决它[注意:我使用的是ubuntu,所以在“g ++”你必须使用“gcc”如果你正在使用任何其他操作系统]:

起初我将存储库克隆到我的本地机器,并做了一些更改,看看下面的过程:

 git clone git://github.com/eventmachine/eventmachine.git cd eventmachine gem install rake-compiler rake-compiler cross-ruby VERSION=xxx-px 

在xxx-px的地方你必须使用你的ruby版本。 请参阅这里与rake-compiler兼容的ruby可用版本列表

然后在/eventmachine/ext/extconf.rb/eventmachine/ext/fastfilereader/extconf.rb文件中输入CONFIG['CXX'] = "g++" ,右下方require 'mkmf'行。 然后做: rake gem ,之后: rake gem:install

它对我有用,希望它也适合你。

来自docs。

EventMachine可能需要以下依赖项,具体取决于您的具体用法:

 * OpenSSL * libstd++ (some systems, such as debian, may require an explicit 

安装以便编译器支持此)

如果你使用的是debian,请尝试安装它

 sudo apt-get install libstdc++6 

我正在使用Ubuntu 16.10 sudo apt-get install ruby-dev build-essential然后sudo gem install eventmachine 。 这解决了我。

请记住运行rvm要求并按照附加依赖项中的说明进行操作。

对于运行openSUSE的所有用户,您需要执行以下命令:

 zypper in -t pattern devel_C_C++ 

为简单起见,我们可以说这相当于Ubuntu下的这个命令:

 sudo apt-get install build-essential