My gut feeling is that this is (again) a mac/OSX-thing: the front end and the back end assume a different location for the unix-domain socket (which functions as a rendezvous point).
Checklist:
ps aux | grep postgres | grep -v grep
should do the trickfind / -name .s.PGSQL.5432 -ls
(the socket used to be in /tmp; you could start looking there)If postgres is running, and the socket actually exists, you could use:
psql -h /the/directory/where/the/socket/was/found mydbname
(which attempts to connect to the unix-domain socket)
; you should now get the psql prompt: try \d
and then \q
to quit. You could also
try:
psql -h localhost mydbname
.(which attempts to connect to localhost (127.0.0.1)
If these attempts fail because of insufficient authorisation, you could alter pg_hba.conf (and SIGHUP or restart) In this case: also check the logs.
A similar question: Can't get Postgres started
Note: If you can get to the psql prompt, the quick fix to this problem is just to change your config/database.yml
, add:
host: localhost
or you could try adding:
host: /the/directory/where/the/socket/was/found
In my case, host: /tmp