1

I am running Rails 4.2.2 and my postgres gem is 0.17.1 and everything was running fine yesterday but today when I opened the console and tried connecting to the database I saw this error:

PG::ConnectionBad: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

...then when I tried connecting to the database through running psql, I see the following:

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
  Referenced from: /usr/local/bin/psql
  Reason: image not found
Abort trap: 6

As far I know I havent changed anythingsince yesterday so I'm not sure why this is happenning. I tried adding host: localhost to my database.yml with no luck. It may be worth noting when I try to connect to the DB using a program like PSequel, I see the following:

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?

Has anyone seen this?

Jeremy Thomas
  • 6,240
  • 9
  • 47
  • 92

1 Answers1

0

Neara's response to this post provided an answer for me: PostgreSQL server won't stop.

Basically had to run:

$ brew services list
$ brew services restart postgresql

They posted a workaround in case services cannot be found.

Community
  • 1
  • 1
Jeremy Thomas
  • 6,240
  • 9
  • 47
  • 92