0
0

More than 3 years have passed since last update.

seeds.rbを本番環境に反映させる方法

Last updated at Posted at 2020-12-25

はじめに

開発環境から本番環境に移行する際に、seeds.rbの内容は本番環境のデータベースに引き継がれないので、本番環境でseeds.rbをデータベースに反映させる操作が必要になります。

環境

  • Rails 5.2.3
  • AWS ( RDS : MySQL 5.7.22 )

手順

1.EC2にログインする。
2.作成したアプリ上に移動する。

 cd アプリ名

3.currentディレクトリに移動する。

 cd current

4.railsコマンドを実行。

 rails db:seed RAILS_ENV=production

以上

終わりに

初学者+Qiita初投稿のため、分かりにくい記事かもしれないですが、何かのお役に立てれば幸いです。

0
0
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
0
0