rodcul / issues

1 stars 0 forks source link

PSQL not opening/accessible on my Laptop #9

Open curlygirly opened 9 years ago

curlygirly commented 9 years ago

Hi Guys, I was running an Rspec test and the error message that returned was something i had never seen before:

Could not connect to server: Connection refused (DataObjects::ConnectionError) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused

After googling it, I found it was to do with PSQL; but I cannot connect with psql, although it does recognise it is there. This is the error message I get :

psql: 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"?

Has anyone encountered this before? I have googled the error and the solutions all come with commands using Sudo and I am very wary of using it.

Any ideas? Thanks

Jennifer

MollieS commented 9 years ago

Hey Jennifer, I don't know if this helps, but I got a very similar error to the first one:

Could not connect to server: Connection refused (DataObjects::ConnectionError) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused

But that was when I was trying to push to heroku. I fixed it just by adding a database to my heroku site with: $ heroku addons:create heroku-postgresql

But if it's a local error with an rspec test, I'm not sure if it'll help. Sorry for the useless response!

ptolemybarnes commented 9 years ago

I've looked over this with Jennifer and though we can't debug it right now (as it's working ^_^), installing and running this might solve the problem in future: http://postgresapp.com/

ptolemybarnes commented 9 years ago

I'm going to close this. @curlygirly please reopen if you do encounter (and fix!) this problem.

tansaku commented 9 years ago

@ptolemybarnes you say you were going to close this, but you haven't ... :-) and I notice I don't have permissions to do so myself ...