There are a few other issues similar to this on stack overflow however they don't fix it and are not related to Mavericks, I think this is a Mavericks specific issue.
I have a fresh install of Mavericks and I have brew installed postgres however I’m getting a strange error when running my rails app:
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
Postgres is up and running, I can view the whole database in the command line. Rails console also throws this error.
There is a /tmp/.s.PGSQL.5432.lock file that looks similar t othe one this is looking for.
There is no .s.PGSQL.5432 file in the directory it’s looking for.
In my database.yml in rails I have the host set as localhost.
Can anyone tell me what this error is about and how to fix it please.
Your client (psql or whatever) is configured to look for unix sockets in /var/run but your server is using /tmp. This suggests that your psql is an old version rather than whatever you compiled - check your PATH.
You can use the path as a hostname:
psql -h /tmp -p 5432 ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With