![](/img/trans.png)
[英]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.