【问题标题】:Failed to install "gem install eventmachine". I need starling in my project, for starling i need to install eventmachine未能安装“gem install eventmachine”。我的项目中需要八哥,对于八哥我需要安装 eventmachine
【发布时间】:2011-01-19 12:36:21
【问题描述】:

我的控制台出现以下错误

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

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

【问题讨论】:

  • 我已经修复了控制台输出的缩进。以后显示代码或输出时请使用四格缩进。
  • 这个“我”。 (in make: I.: Command not found) 表示构建不知道使用哪个编译器应该是g++。

标签: ruby-on-rails


【解决方案1】:

我在 Ubuntu 11.10 安装 eventmachine 时遇到了类似的问题。
不同之处在于(接近日志末尾)

make: g++: Command not found

而不是

make: I.: Command not found

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

sudo apt-get install build-essential 

【讨论】:

    【解决方案2】:

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

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

    【讨论】:

    • 我的 ruby​​ 版本是 ruby​​ 1.8.7 (2010-12-23 patchlevel 330) [x86_64-linux] 我的操作系统是 Ubuntu 10.04 LTS (Lucid Lynx)
    • 这适用于 Debian,因为缺少 ruby​​-dev。安装后,它工作了。
    【解决方案3】:

    我遇到了同样的问题,这是如何解决的[注意:我使用的是 ubuntu,因此在“g++”中,如果您使用任何其他操作系统,则必须使用“gcc”]:

    一开始我把仓库克隆到我的本地机器上,做了一些改动,看看下面的过程:

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

    在 x.x.x-px 的地方你必须使用你的 ruby​​ 版本。查看与 rake-compiler here 兼容的 ruby​​ 可用版本列表

    然后把这个:CONFIG['CXX'] = "g++" 放在 /eventmachine/ext/extconf.rb/eventmachine/ext/fastfilereader/extconf.rb 文件中,就在下面require 'mkmf' 线。 然后执行:rake gem 之后:rake gem:install

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

    【讨论】:

      【解决方案4】:

      我使用的是 Ubuntu 16.10 sudo apt-get install ruby-dev build-essential,然后是 sudo gem install eventmachine。这为我解决了。

      【讨论】:

      • 我有同样的问题,这个答案解决了我的问题。谢谢@Online Sid
      【解决方案5】:

      来自文档。

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

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

      为了让编译器安装 支持这个)

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

      sudo apt-get install libstdc++6
      

      【讨论】:

      • 您好安德里亚,感谢您的回答。我已经手动安装了 c++。但它对我不起作用。
      【解决方案6】:

      记得运行 rvm requirements 并按照附加依赖项中的说明进行操作。

      【讨论】:

        【解决方案7】:

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

        zypper in -t pattern devel_C_C++ 
        

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

        sudo apt-get install build-essential 
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2013-06-26
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2017-10-04
          相关资源
          最近更新 更多