0

When I run the command: rake db:migrate RAILS_ENV=production I get the following error:

rake aborted!
PG::ConnectionBad: could not connect to server: Connection refused
        Is the server running on host "1.2.3.4" and accepting
        TCP/IP connections on port 5432?

So I guess my server is not listening on port 5432. So how do I solve this?

I tried running command: sudo service postgresql start but I still get that same error.

I know I have to edit some file so in addition to the instructions on how to actually edit the file (I guess it is the file named postgresql.conf?) please also tell me where I should find it.

My web application is on this directory at the server: /home/admin/www/webstudio

EDIT: I have already tried my best to follow the instructions given here: http://alexbachuk.com/launch-rails-4-application-with-passenger-and-nginx/

  • 1
    The obvious solution is to start postgresql. – Michael Hampton Sep 02 '14 at 12:52
  • Yes, I guess it is obvious :) So how do I do that? postgre -D %PATH%? I found that from one site, but I don't know the path.. What could it be? I'm a complete novice to this all so please bear with me. – Tommi Tiihonen Sep 02 '14 at 13:12
  • I started postgresql with a command: sudo service postgresql start but it didn't help :( – Tommi Tiihonen Sep 02 '14 at 13:53
  • Two things now: First, [don't use other people's public IP addresses in your posts](http://meta.serverfault.com/q/963/126632). Second, look at your logs and find out what's going on with postgresql. – Michael Hampton Sep 02 '14 at 14:14

0 Answers0