问题
Had some trouble with bundler trying to install the 'nokogiri' gem, so we went ahead and installed it manually with 'gem install nokogiri' - this was within an RVM ruby, and installed with native extensions.
Now, when running 'bundle install', it appears that bundle still tries to install nokogiri! I've seen it said that when bundle runs, it checks locally for gems first, why might this not be happening?
UPDATE:
We are using Capistrano to deploy, and when i override the 'bundle:install' task to just run 'gem list --local', i get the following output:
* 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
and since, in our Gemfile, the require looks like:
gem "nokogiri", "= 1.4.3.1"
it looks to me like the right gem version is installed. But when going back to standard 'bundle:install' task, the output includes:
* 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]
来源:https://stackoverflow.com/questions/11019742/when-running-bundle-install-bundler-tries-to-install-gem-that-is-already-inst