Well, this makes little sense to me, but it is a work-around for this
problem.
Add the following line to your deploy.rb file:
before "deploy:assets:precompile", :bundle_install
I've also run (on the server) "bundle config path vendor/cache" and
placed "export BUNDLE_PATH=vendor/cache" in the .bashrc file.
Now, before precompiling the assets, the bundler installs the gems,
apparently into vendor cache. The last few lines are:
** [out :: <server name>] Installing will_paginate (3.0.2)
** [out :: <server name>]
** [out :: <server name>] Updating .gem files in vendor/cache
** [out ::<server name>] Your bundle is complete! It was installed into
./vendor/cache
command finished in 103066ms
and the deployment continues to completion.
The end of my deploy.rb file looks like...
# This is a hack to avoid deployment failure on the assets:precompile
step
# Failure is "Could not find <some gem> in any of the sources"
# seems to be a bundler problem, as all gems are in vendor/cache, and
shouldn't need
# a bundle:install command
before "deploy:assets:precompile", :bundle_install
after "deploy:update_code", :bundle_install
desc "install the necessary prerequisites"
task :bundle_install, :roles => :app do
run "cd #{release_path} && bundle install"
end
See here for an explanation to this issue, that was presumably closed
last September...
https://github.com/capistrano/capistrano/issues/81