Red Hat Linux + Rails + RVM:Gem :: Installer :: ExtensionBuildError:错误:无法构建gem原生扩展

时间:2013-08-26 14:34:57

标签: ruby-on-rails linux gem

所以我试图将我的Rails 3应用程序部署到使用RVM的Red Hat Linux服务器上,但它仍然失败:

    ** [out :: myserver.server.com] Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
    ** [out :: myserver.server.com] 
    ** [out :: myserver.server.com] /usr/local/rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
    ** [out :: myserver.server.com] checking for vm_core.h... no
    ** [out :: myserver.server.com] checking for vm_core.h... no
    ** [out :: myserver.server.com] Makefile creation failed
    ** [out :: myserver.server.com] **************************************************************************
    ** [out :: myserver.server.com] No source for ruby-1.9.3-p448 provided with debugger-ruby_core_source gem.
    ** [out :: myserver.server.com] **************************************************************************
    ** [out :: myserver.server.com] *** extconf.rb failed ***
    ** [out :: myserver.server.com] Could not create Makefile due to some reason, probably lack of
    ** [out :: myserver.server.com] necessary libraries and/or headers.  Check the mkmf.log file for more
    ** [out :: myserver.server.com] details.  You may need configuration options.
    ** [out :: myserver.server.com] 
    ** [out :: myserver.server.com] Provided configuration options:
    ** [out :: myserver.server.com] --with-opt-dir
    ** [out :: myserver.server.com] --without-opt-dir
    ** [out :: myserver.server.com] --with-opt-include
    ** [out :: myserver.server.com] --without-opt-include=${opt-dir}/include
    ** [out :: myserver.server.com] --with-opt-lib
    ** [out :: myserver.server.com] --without-opt-lib=${opt-dir}/lib
    ** [out :: myserver.server.com] --with-make-prog
    ** [out :: myserver.server.com] --without-make-prog
    ** [out :: myserver.server.com] --srcdir=.
    ** [out :: myserver.server.com] --curdir
    ** [out :: myserver.server.com] --ruby=/usr/local/rvm/rubies/ruby-1.9.3-p448/bin/ruby
    ** [out :: myserver.server.com] --with-ruby-dir
    ** [out :: myserver.server.com] --without-ruby-dir
    ** [out :: myserver.server.com] --with-ruby-include
    ** [out :: myserver.server.com] --without-ruby-include=${ruby-dir}/include
    ** [out :: myserver.server.com] --with-ruby-lib
    ** [out :: myserver.server.com] --without-ruby-lib=${ruby-dir}/lib
    ** [out :: myserver.server.com] 
    ** [out :: myserver.server.com] 
    ** [out :: myserver.server.com] Gem files will remain installed in /usr/local/www/sherry-authorize-staging/shared/bundle/ruby/1.9.1/gems/debugger-linecache-1.1.2 for inspection.
    ** [out :: myserver.server.com] Results logged to /usr/local/www/sherry-authorize-staging/shared/bundle/ruby/1.9.1/gems/debugger-linecache-1.1.2/ext/trace_nums/gem_make.out
    ** [out :: myserver.server.com] An error occurred while installing debugger-linecache (1.1.2), and Bundler
    ** [out :: myserver.server.com] cannot continue.
    ** [out :: myserver.server.com] Make sure that `gem install debugger-linecache -v '1.1.2'` succeeds before
    ** [out :: myserver.server.com] bundling.

所以我听了指示并确保gem可以通过SSH连接到服务器并运行gem install debugger-linecache -v '1.1.2'来安装在该服务器上,甚至可以去服务器并手动克隆git repo并运行{{1这样所有的宝石都存在于该服务器上。然而,即使有所有宝石,每当我部署时,我仍然得到同样的信息。我以任何用户身份登录并输入bundle install并显示所有宝石。宝石看起来也像是全球性的,并且位于正确的位置:

gem list

有谁知道如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

所以我只是听了Geoffroy并安装了rvm-capistrano宝石,并将这些行添加到我的capistrano脚本

set :bundle_dir, ''
set :bundle_flags, '--system --quiet'
set :rvm_type, :system

它有效!