LoginSignup
1
2

More than 5 years have passed since last update.

db:migrateが何故だか失敗する

Posted at
$ RAILS_ENV=production bin/rake db:migrate #失敗
$ RAILS_ENV=production bundle exec rake db:migrate #成功

どうやら、bin/rakeを使うとspringってのが動くのだがこれが悪さしていたようだ。
production環境では、bundle execを使う方が無難とのこと。

SpringはRailsアプリケーション用のプリローダーです。アプリケーションをバックグラウンドで常駐させることで開発速度を向上させ、テストやrakeタスク、マイグレーションを実行するたびにRailsを起動しないで済むようにします。

Rails 4.1アプリケーションに含まれるbinstubは「spring化」されています。これは、アプリケーションのルートディレクトリでbin/railsおよびbin/rakeを実行すると自動的にspring環境をプリロードするということです。
https://railsguides.jp/4_1_release_notes.html

1
2
0

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
1
2