我正在使用 postgresql 9.3 运行一个正在开发的 rails 应用程序。当我今天尝试启动乘客服务器时,我得到:
PG::ConnectionBad - could not connect to server: Connection refused
Is the server running on host "localhost" (217.74.65.145) and accepting
TCP/IP connections on port 5432?
Run Code Online (Sandbox Code Playgroud)
我觉得没什么大不了的,以前发生过。重启 postgres 总能解决问题。所以我跑了sudo service postgresql restart
,得到:
* Restarting PostgreSQL 9.3 database server
* The PostgreSQL server failed to start. Please check the log output:
2014-06-11 10:32:41 CEST LOG: could not bind IPv4 socket: Cannot assign requested address
2014-06-11 10:32:41 CEST HINT: Is another postmaster already running on port …
Run Code Online (Sandbox Code Playgroud) postgresql ×1