Connection Refused (PGError) (postgresql And Rails)
Answer : The error message is instrumental: could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5433? port You may be trying to connect to the wrong port. Standard port is 5432 . Check how (and whether at all) you started your postgres server: postgres@db:~$ ps -auxww | grep ^postgres ... <stripped more lines> postgres 1274 0.0 0.3 1437240 57308 ? S May27 5:01 /usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf The manual has related information here. In my example, settings from /etc/postgresql/9.1/main/postgresql.conf got used, which says (among many other settings): port = 5432 Or run: netstat -nlp | grep postgres Or just look here (at least in Debian or Ubuntu): ls -lA /var/run/postgresql/ PostgreSQL picks the next free port if you create a new database cluster. Since you installed repeatedl...