Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config/database.yml で直接設定の指定を行わ無いようにしたい #1317

Merged
merged 1 commit into from
Jul 12, 2021

Conversation

nanophate
Copy link
Member

@nanophate nanophate commented Jul 12, 2021

やりたいこと

config/database.yml で hostname などの指定があるためエラーになりました。ファイルでは直接 hostname などの指定を行わない様にしたい。

PG::ConnectionBad: could not translate host name "db" to address: nodename nor servname provided, or not known

関連: #1315

Copy link
Contributor

@rakuda-san-desu rakuda-san-desu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

早々に対応ありがとうございます!
bin/setup が正常に動作し、ローカルサーバーが立ち上がり問題なく表示されました✨

@nanophate
Copy link
Member Author

レビューありがとうございます 🙇

@nanophate nanophate merged commit 6c4879b into master Jul 12, 2021
@nanophate nanophate deleted the set-github-db-env branch July 12, 2021 02:17
@nanophate
Copy link
Member Author

heroku rollback v2200 念のためのロールバック準備

@shishi
Copy link
Member

shishi commented Jul 12, 2021

ENV.fetch に書かれていた値は対象の環境変数がないときのデフォルト値です。その何も指定しないことにしたのも昔の僕のようですが、デフォルト値を設定しないことにメリットはないので、環境の違いは環境変数で切り替えるようにすればいいかと思いました。エスパーすると、ローカルサーバー とおっしゃっているので、何も環境変数を設定していない結果、ただデフォルトの localhost につなぎにいって失敗されているのでしょう。docker を基準に環境は数年前に作ったのでデフォルト値もそれを基準としています。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants