Wrong socket directory?
Sometimes there is a mismatch in actual socket directory and where the adapter thinks it is, then you'll see an error like this:
could not connect to server: No such file or directory
Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
In that case explicitely set the socket directory in database.yml like this:
development: adapter: postgresql host: /tmp ...
Discussion
Wrong socket directory?
Sometimes there is a mismatch in actual socket directory and where the adapter thinks it is, then you'll see an error like this:
could not connect to server: No such file or directory
In that case explicitely set the socket directory in database.yml like this: