【发布时间】:2013-12-10 19:11:42
【问题描述】:
我遇到了一个强度错误,当我尝试使用 capistrano 部署我的应用程序时,它会在捆绑安装时停止,它说:
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 版本与那些 gem 不兼容? 我在 Eventmachine 网站上找到:EventMachine 支持 Ruby 1.8.7、1.9.2 在 nokogiri 网站上:要求:ruby 1.8 或 1.9
已编辑
这是我的 gem 环境:
- 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
【问题讨论】:
-
你能把记录的错误贴在指定的位置吗?
-
错误日志包含一行:/home/deployer/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
-
不是兼容性问题,eventmachine 1.0.3 完美兼容ruby-2.0.0-p353
-
你能用这个内容在你的项目目录中创建 2 个文件吗?
$ vim .ruby-version和2.0.0和$ vim .ruby-gemset和myprojectgemset并再次部署。看起来您有一些二进制文件指向了错误的 ruby 版本。 -
我用 2.0.0 创建了 .ruby-version,用 holo(我的项目名称)创建了 .ruby-gemset。但它又失败了
标签: ruby-on-rails ruby ruby-on-rails-3.2 rubygems capistrano