I am using capistrano 3 and I run cap staging deploy
. After various commands, it then runs rake db:migrate
, which looks like this:
INFO [f67aeefb] Running /usr/local/rvm/bin/rvm ruby-2.1.2@core do bundle exec rake db:migrate as deploy@10.10.4.131 DEBUG [f67aeefb] Command: cd /var/www/mysite_staging/releases/20150617233945 && ( RAILS_ENV=staging /usr/local/rvm/bin/rvm ruby-2.1.2@core do bundle exec rake db:migrate ) DEBUG [f67aeefb] "Env => staging"
The problem is the migration appears to have run in production, not in staging.
How can I ensure capistrano runs the migrations in staging when I specify staging during the deploy?