运行“bundle install”时,bundler会尝试安装已在本地安装的gem

时间:2012-06-13 16:59:09

标签: ruby-on-rails rubygems bundler

捆绑器尝试安装'nokogiri'宝石时遇到了一些麻烦,所以我们继续使用'gem install nokogiri'手动安装它 - 这是在RVM ruby​​中,并使用原生扩展安装。

现在,当运行'bundle install'时,看来bundle仍然试图安装nokogiri!我已经看到它说当捆绑运行时,它首先在本地检查宝石,为什么不会发生这种情况?

更新:

我们正在使用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中,需要看起来像:

gem "nokogiri", "= 1.4.3.1"

在我看来,安装了正确的宝石版本。但是当回到标准的“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]

0 个答案:

没有答案