捆绑器尝试安装“nokogiri”gem 时遇到了一些问题,所以我们继续使用“gem install nokogiri”手动安装它——这是在 RVM ruby 中,并使用本机扩展安装。
现在,当运行“捆绑安装”时,捆绑似乎仍在尝试安装 nokogiri!我看到它说当 bundle 运行时,它首先在本地检查 gems,为什么这不会发生?
更新:
我们正在使用 Capistrano 进行部署,当我覆盖 'bundle:install' 任务以仅运行 'gem list --local' 时,我得到以下输出:
* executing "gem list --local"
servers: ["myServer"]
[myServer] executing command
** [out :: myServer] actionmailer (3.2.3, 3.0.11, 2.3.5)
** [out :: myServer] actionpack (3.2.3, 3.0.11, 2.3.5)
** [out :: myServer] activemodel (3.2.3, 3.0.11)
** [out :: myServer] activerecord (3.2.3, 3.0.11, 2.3.5)
** [out :: myServer] activeresource (3.2.3, 3.0.11, 2.3.5)
** [out :: myServer] activesupport (3.2.3, 3.0.11, 2.3.5)
** [out :: myServer] bundler (1.0.22, 1.0.21 ruby)
** [out :: myServer] capistrano (2.12.0)
...
** [out :: myServer] nokogiri (1.4.3.1)
...
command finished in 863ms
因为,在我们的 Gemfile 中,require 看起来像:
gem "nokogiri", "= 1.4.3.1"
在我看来,安装了正确的 gem 版本。但是当回到标准的 'bundle:install' 任务时,输出包括:
* executing "cd /path/to/releases/20120619165617 && bundle install --gemfile /path/to/releases/20120619165617/Gemfile --path /path/to/shared/bundle"
servers: ["myServer"]
[myServer] executing command
** [out :: myServer] Fetching source index for http://rubygems.org/
** [out :: myServer] Using rake (0.9.2.2)
** [out :: myServer]
** [out :: myServer] Using activesupport (2.3.5)
** [out :: myServer]
** [out :: myServer] Using rack (1.0.1)
** [out :: myServer]
** [out :: myServer] Using actionpack (2.3.5)
** [out :: myServer]
** [out :: myServer] Using actionmailer (2.3.5)
** [out :: myServer]
** [out :: myServer] Using activerecord (2.3.5)
** [out :: myServer]
** [out :: myServer] Using activeresource (2.3.5)
...
** [out :: myServer] Installing nokogiri (1.4.3.1)
** [out :: myServer] with native extensions
** [out :: myServer]
** [out :: myServer] ←[33mGem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
** [out :: myServer]