Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
OrganizationAdvent CalendarQiitadon (β)
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?


More than 3 years have passed since last update.
  • 蓋を開けて見れば非常に下らないのですが、検索方法が分からずハマってしまったので自分用にメモ書きしておきます


  • Railsでconfig/database.ymlで接続するデータベースやホストを指定してもrails dbで接続したときにいつも固定のデータベースに接続してしまう


  • windows10
  • rails 4.2.5


3.14 Configuring a Database
Just about every Rails application will interact with a database. You can connect to the database by setting an environment variable ENV['DATABASE_URL'] or by using a configuration file called config/database.yml.
  • 環境変数のDATABASE_URLかconfig/database.ymlの設定を見るよ

    • 環境変数を見てみると...いつ登録したのか分からないDATABASE_URL...これか...
  • 環境変数を変更したら忘れずにシェルを再起動してください

  • 終わりです。貴重な土曜日が...

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away