Ruby on rails 无法在生产服务器上构建gem本机扩展
我遇到了一个strengh错误,当我尝试使用capistrano部署我的应用程序时,它会在bundle安装时停止,它会说:Ruby on rails 无法在生产服务器上构建gem本机扩展,ruby-on-rails,ruby,ruby-on-rails-3.2,rubygems,capistrano,Ruby On Rails,Ruby,Ruby On Rails 3.2,Rubygems,Capistrano,我遇到了一个strengh错误,当我尝试使用capistrano部署我的应用程序时,它会在bundle安装时停止,它会说: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /home/deployer/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb Gem files will remain installed in /hom
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/deployer/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
Gem files will remain installed in
/home/deployer/apps/Myapp/shared/bundle/ruby/2.0.0/gems/eventmachine-1.0.3
Results logged to /home/deployer/apps/Myapp/shared/bundle/ruby/2.0.0/gems/eventmachine-1.0.3/ext/gem_make.out
Make sure that `gem install eventmachine -v '1.0.3'` succeeds before bundling.
我试图从服务器安装它:gem install eventmachine-v'1.0.3',它成功了,但当我从本地重新部署时失败了
nb:我和nokogiri犯了同样的错误,这让我很恼火,所以我放弃了
解决办法是什么
编辑
是因为我的ruby版本与那些gems不兼容吗?
我在Eventmachine站点上发现:Eventmachine支持Ruby 1.8.7、1.9.2
在nokogiri站点上:要求:ruby 1.8或1.9
编辑
以下是我的创业板环境:
- RUBYGEMS VERSION: 2.1.11
- RUBY VERSION: 2.0.0 (2013-11-22 patchlevel 353) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/deployer/.rvm/gems/ruby-2.0.0-p353
- RUBY EXECUTABLE: /home/deployer/.rvm/rubies/ruby-2.0.0-p353/bin/ruby
- EXECUTABLE DIRECTORY: /home/deployer/.rvm/gems/ruby-2.0.0-p353/bin
- SPEC CACHE DIRECTORY: /home/deployer/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/deployer/.rvm/gems/ruby-2.0.0-p353
- /home/deployer/.rvm/gems/ruby-2.0.0-p353@global
- SHELL PATH:
- /home/deployer/.rvm/gems/ruby-2.0.0-p353/bin
- /home/deployer/.rvm/gems/ruby-2.0.0-p353@global/bin
- /home/deployer/.rvm/rubies/ruby-2.0.0-p353/bin
升级rvm并在目标prod服务器上运行rvm要求
$ rvm get head
$ rvm reload
$ rvm requirements
您能在指定的位置发布记录的错误吗?错误日志包含一行:/home/deployer/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rbIs不是兼容性问题,eventmachine 1.0.3与ruby-2.0.0-p353完全兼容。您能在项目的目录中创建两个包含此内容的文件吗?$使用2.0.0的vim.ruby版本和使用myprojectgemset的$vim.ruby gemset,并再次部署。看起来有些二进制文件指向了错误的ruby版本。我用2.0.0创建了.ruby版本,用holo创建了.ruby gemset,这是我项目的名称。但它又失败了,你在目标服务器上运行了吗?如果没有,请继续阅读:我看到您尝试手动安装eventmachine并成功。您是否可以尝试这样做:将ssh插入目标服务器并运行$rvm use system,然后像以前一样尝试安装gem eventmachine。如果失败,那么capistrano在部署时选择了错误的ruby版本。请看我对向您的项目中添加.ruby版本和.ruby gemset的评论。我尝试按照您所说的设置rvm系统,但仍然收到相同的错误,我还将deploy.rb中的rvm_类型从user更改为system set:rvm_类型,:user,但得到:error:rvm ruby未使用,请先运行rvm use ruby。