LoginSignup
7

More than 5 years have passed since last update.

Capistrano のデプロイ時にmigrateされない現象

Posted at

Capfileに

 require 'capistrano/rails/migrations'

と書いてたが、

$ cap staging deploy:migrate --dry-run --trace
** Invoke staging (first_time)
** Execute staging
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke deploy:set_rails_env (first_time)
** Execute deploy:set_rails_env
** Invoke deploy:set_rails_env 
** Invoke deploy:migrate (first_time)
** Invoke deploy:set_rails_env 
** Execute deploy:migrate
$

と実行されないので、確認してみた。

http://d.hatena.ne.jp/akishin999/20140516/1400251748
を参照してみて config/deploy/staging.rb のサーバのrolesに、dbがないことが原因と判明。

ブログにも書いてあるけど、わかってしまえばそりゃそうだよな。となりますね……。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7