LoginSignup
1
2

More than 5 years have passed since last update.

database.ymlの設定で正しくDBを作成できるか確認するコマンド

Last updated at Posted at 2018-05-17

やり方をよく忘れるので備忘録。

例えば環境変数が以下のように2つあったとします。

  • DATABASE_USERNAME
  • DATABASE_PASSWORD

開発環境の場合、通常は dotenv 等で環境変数をセットしますが一時的に環境変数をセットする場合は以下のように…

$ RAILS_ENV=<specific_environment> DATABASE_USERNAME=username DATABASE_PASSWORD=password rails db:create

これでよし。

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