[英]Rails db:create using PostgreSQL return PG::ConnectionBad: could not connect to server: Connection refused
[英]How to connect rails with postgresql on docker? Getting: could not connect to server: Connection refused
我遵循了本教程: https : //thoughtbot.com/blog/rails-on-docker
當我跑步...
docker-compose run web rake db:create db:setup
...我得到這個錯誤:
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
而不是使用localhost
或127.0.0.1
使用
使用docker.for.mac.host.internal
嘗試https://stackoverflow.com/a/52858101/5616944
使用host.docker.internal
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.