Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 安装eventmachine gem时出错_Ruby On Rails_Ruby_Ruby On Rails 3_Rubygems_Gem - Fatal编程技术网

Ruby on rails 安装eventmachine gem时出错

Ruby on rails 安装eventmachine gem时出错,ruby-on-rails,ruby,ruby-on-rails-3,rubygems,gem,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': Cou

运行
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$
再次出现错误: 安装eventmachine(0.12.10)时出错,绑定程序无法继续。请确保gem安装eventmachine-v“0.12.10”在绑定之前成功

现在当我这么做的时候

sudo gem install eventmachine -v '0.12.10'
我再次得到一个错误,它说:

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

请告诉我我缺少什么。

您需要运行
捆绑安装
您的计算机上没有安装Gemfile中所需的Gem。

尝试安装openssl和libstdc++。
如果您使用的是rvm,并且已经在单用户模式下安装了ruby,那么应该省略sudo

你能粘贴错误的完整日志吗?这样回答你的问题就容易多了

更新
请在另一个stackoverflow线程中参考此答案,并让我知道它是否有效

尝试更新您的系统RubyGems

  • rvm稳定下来
  • 最新版本
  • 我希望这对您有用。

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

    sudo-apt-get-install-build-essential

    然后
    bundle安装
    gem安装eventmachine

    应该足够了


    注意:如果您有rbenv,请记住为无法使用上述方法解决问题的其他人在
    捆绑安装后运行
    rbenv rehash

    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所述。

    尝试
    gem安装eventmachine--with openssl dir=/usr/local/opt/openssl@1.1

    我确实安装了bundle,但现在我收到另一个错误,上面写着:“安装eventmachine(0.12.10)时出错,绑定程序无法继续。请确保绑定前
    gem install eventmachine-v'0.12.10'
    成功。“当我尝试执行
    sudo gem install eventmachine-v'0.12.10'
    时,它再次提示一个新错误,该错误表示“错误:安装eventmachine时出错:错误:无法构建gem本机扩展。”这可能是问题所在,您可以尝试在命令行上运行
    gcc
    ,它会提示您安装命令行utils。错误日志:还有您的操作系统详细信息,ruby versionLinux pallav System Product Name 3.11.0-14-generic 21 Ubuntu SMP Tue Nov 12 17:04:55 UTC 2013 x86_64 x86_64 GNU/Linuxruby 1.9.3p194(2012-04-20修订版35410)[x86_64-linux]找不到“project.h”文件位置,“gem install eventmachine”没有帮助。请同时检查:gem_make.outError日志
    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\"