I have a question about Ruby on Rails and Capistrano deploys. The first thing I do is deploy my Rails App using:
cap deploy:update
When I have migration, I try to run the Capistrano command:
cap deploy:migrations
I get the error:
Could not find rake-0.9.2 in any of the sources
I have to SSH into the current folder of the server and manually run
rake RAILS_ENV=production db:migrate
Which is obviously a huge pain to run every deploy with a migration.
What am I doing wrong? Thanks for the help.
You might need to uncomment and adjust the following lines in your
config/deploy.rb
:Additionally, if you are using RVM, you might need to add a few lines:
you have a newer version of rake gem on local, but the remote server has the older one which works correctly with Rails version you use.
Can you check it with "gem list |grep rake" local and remotely. you can specify rake gem version in your Gemfile and redeploy the application
it sounds like the deploy:migrations task isn't getting the right bash environment. Can you see the full command that's being run on the server? Is it using sudo? Is it using bundler? Get the whole command and try running that from your SSH session.
To pull in the Bundler Cap task, just add this to your deploy.rb file:
Running cap deploy will now automatically run bundle install on the remote server with deployment-friendly options, and rake will be available for the following steps of the deployment.
A list of options that can be changed is available in the help for the cap task. To see it, run cap -e bundle:install.