安装eventmachine gem时出错

时间:2013-12-12 04:49:00

标签: ruby-on-rails ruby ruby-on-rails-3 rubygems gem

当我运行foreman start时,我收到以下错误:

pallav@pallav-System-Product-Name:~/Workspace/Aadvisor$ foreman start
10:04:32 web.1  | started with pid 11022 10:04:32 web.1  |
/var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in
`block in materialize': Could not find eventmachine-0.12.10 in any of
the sources (Bundler::GemNotFound) 10:04:32 web.1  |  from
/var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in
`map!' 10:04:32 web.1  |  from
/var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in
`materialize' 10:04:32 web.1  |   from
/var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in
`specs' 10:04:32 web.1  |   from
/var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in
`specs_for' 10:04:32 web.1  |   from
/var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in
`requested_specs' 10:04:32 web.1  |   from
/var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in
`requested_specs' 10:04:32 web.1  |   from
/var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in
`setup' 10:04:32 web.1  |   from
/var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
10:04:32 web.1  |   from
/var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in
`<top (required)>' 10:04:32 web.1  |  from
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
10:04:32 web.1  |   from
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
10:04:32 web.1  | exited with code 1 10:04:32 system | sending SIGTERM
to all processes SIGTERM received
pallav@pallav-System-Product-Name:~/Workspace/Aadvisor$

我也做了

sudo bundle install

再次出错: “安装eventmachine(0.12.10)时发生错误,Bundler无法继续。确保gem install eventmachine -v'0.12.10'在捆绑之前成功。”

现在我做的时候

sudo gem install eventmachine -v '0.12.10'

我再次收到错误消息:

"ERROR: Error installing eventmachine: ERROR: Failed to build gem native extension."

请告诉我我错过了什么。

6 个答案:

答案 0 :(得分:6)

要在Ubuntu 14.04上安装 eventmachine 1.0.3 ,首先需要运行:

sudo apt-get install build-essential

然后bundle installgem install eventmachine

应该足够了。

注意:如果您有rbenv,请务必在rbenv rehash之后运行bundle install

答案 1 :(得分:2)

尝试安装openssl和libstdc ++ 如果你使用rvm并在单用户模式下安装了ruby,你应该省略sudo。

您可以粘贴错误的完整日志吗?用这个更容易回答你的问题。

<强>更新 请参考另一个stackoverflow线程中的这个答案https://stackoverflow.com/a/17386686/846970,让我知道它是否有效。

答案 2 :(得分:1)

您需要运行bundle install您的计算机上没有安装Gemfile所需的宝石。

答案 3 :(得分:0)

尝试更新您的系统RubyGems。

  1. rvm稳定
  2. rvm ruby​​gems latest
  3. 我希望这适合你。

答案 4 :(得分:0)

对于无法使用上述方法解决的其他人:

sudo -u gitlab -H bundle config build.eventmachine --with-cflags=\"-O2 -pipe -march=native -w\"
sudo -u gitlab -H bundle config build.thin --with-cflags=\"-O2 -pipe -march=native -w\"

正如用户enrico here所述。

答案 5 :(得分:0)

试试gem install eventmachine -- --with-openssl-dir=/usr/local/opt/openssl@1.1