LoginSignup
3
2

More than 3 years have passed since last update.

Rails AWS 本番環境でテータベースリセットしてseedデータ投入方法

Last updated at Posted at 2021-01-09

Railsで本番環境でテータベースリセットしてseedデータ投入方法

[ec2-user@******* current]$ RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:drop
[ec2-user@******* current]$ bundle exec rails db:create RAILS_ENV=production
[ec2-user@******* current]$ bundle exec rails db:migrate RAILS_ENV=production
[ec2-user@******* current]$ bundle exec rails db:seed RAILS_ENV=production

上から順番に実行で終わりです。

最後に

bundle execをつけないとエラーになりました。

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