初めて Capistrano を使用して本番環境にデプロイしますが、実行するとエラーが発生します
cap production deploy
エラーは次のとおりです。
** Invoke deploy:migrate (first_time)
** Invoke deploy:set_rails_env
** Execute deploy:migrate
DEBUG [048f89c6] Running /usr/bin/env if test ! -d /home/deployer_user/apps/ap_production/releases/20140209005208; then echo "Directory does not exist '/home/deployer_user/apps/ap_production/releases/20140209005208'" 1>&2; false; fi on eslope.net
DEBUG [048f89c6] Command: if test ! -d /home/deployer_user/apps/ap_production/releases/20140209005208; then echo "Directory does not exist '/home/deployer_user/apps/ap_production/releases/20140209005208'" 1>&2; false; fi
DEBUG [048f89c6] Finished in 0.160 seconds with exit status 0 (successful).
INFO [52f75214] Running ~/.rbenv/bin/rbenv exec bundle exec rake db:migrate on eserver.net
DEBUG [52f75214] Command: cd /home/deployer_user/apps/ap_production/releases/20140209005208 && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.0 RAILS_ENV=production ~/.rbenv/bin/rbenv exec bundle exec rake db:migrate )
DEBUG [52f75214] rake aborted!
DEBUG [52f75214] An error has occurred, this and all later migrations canceled:
DEBUG [52f75214]
DEBUG [52f75214] PG::UndefinedTable: ERROR: relation "client_infos" does not exist
DEBUG [52f75214] : ALTER TABLE "client_infos" RENAME TO "clients
エラーは実際には完全に理にかなっています。参照されたテーブルが存在しません。私が理解できないのは、移行がまったく実行されている理由です。最初の実行時にスキーマからデータベースが作成されないのはなぜですか。どのマイグレーションが実行されたかを示すファイルをうっかり削除してしまったのでしょうか? 単に削除するか、「.gitignoring」するかのどちらかですか?
私はそれを修正する方法を知っていると思います (rake db:create など)。移行?私は初心者です。それは合理的だと思われますが、一方で、移行を実行しても同じ結果が得られるので... (しかし、移行を盲目的に本番環境で使用する方法を知らない人々についてはどうすればよいでしょうか。彼らは立ち往生していますか?) ありがとう。