问题
I am using Ruby on Rails 3.1.0 and the Capistrano gem. As wrote in the Bundler official documentation in the "Automatic deployment with Capistrano" section, I added the require 'bundler/capistrano' to the top of my deploy.rb file.
Now, when I run the cap deploy:migrations command (Deploy and run pending migrations) I get the following error:
...
* executing "cd /<my_application_path>/releases/20111026132212 && bundle install --gemfile /<my_application_path>/releases/20111026132212/Gemfile --path /<my_application_path>/shared/bundle --deployment --quiet --without development test"
servers: ["<my_remote_server_IP>"]
[<my_remote_server_IP>] executing command
** [out :: <my_remote_server_IP>] Some gems seem to be missing from your vendor/cache directory.
** [out :: <my_remote_server_IP>] Could not find libv8-3.3.10.2 in any of the sources
command finished in 2554ms
failed: "sh -c 'cd /<my_application_path>/releases/20111026132212 && bundle install --gemfile /<my_application_path>/releases/20111026132212/Gemfile --path /<my_application_path>/shared/bundle --deployment --quiet --without development test'" on <my_remote_server_IP>
How can I solve the problem?
Note: This is a specific question of a related problem I started to have after this question.
回答1:
Sounds like your local Gemlock file may be out of sync with your remote gemset. If you've recently added gems, make sure you run bundle install on your local fileset to update the Gemlock file, then check in those changes (if any). Re-run the deployment.
来源:https://stackoverflow.com/questions/7905519/trouble-on-deploying-with-bundler-and-capistrano