每次我运行我的rails 4.0服务器,我得到这个输出.
Started GET "/" for 127.0.0.1 at 2013-11-06 23:56:36 -0500
PG::ConnectionBad - could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (fe80::1) and accepting
TCP/IP connections on port 5432?
: …Run Code Online (Sandbox Code Playgroud) 我有一个运行postgres的数据库服务器(192.168.1.50).我创建了一个名为"testdb"的数据库和一个密码为"testuserpw"的用户"testuser".
在本地,我可以使用以下命令连接到数据库:
psql -d testdb -U testuser
Run Code Online (Sandbox Code Playgroud)
当我从另一台主机(192.168.1.60)发出命令时:
psql -h 192.168.1.50 -d testdb -U testuser
Run Code Online (Sandbox Code Playgroud)
我有错误:
psql: could not connect to server: Connection refused
Is the server running on host "192.168.1.50" and accepting
TCP/IP connections on port 5432?
Run Code Online (Sandbox Code Playgroud)
任何的想法 ?