Postgresq-9.2 failed to connect to the Unix Domain Socket

0

I configured the database postgresql-9.2 in my Ubuntu 14.04 and it presents the following error when communicating with the bank

  

Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

I'm using it for an application in Rails 3.2.13.

    
asked by anonymous 05.06.2014 / 21:00

1 answer

1

First, open the terminal and run the following command:

ps auxw | grep postgres

If there is no process named postgres, then the database is not running. If this is the case, enter the following command on your terminal:

sudo service postgresql restart

Casp is running, check the permissions of the /var/run/postgresql/ directory, see if the postgres user has read / write permission. If you do not have this permission, use the following command:

sudo chown postgres /var/run/postgresql/

If it still does not work, locate and check your postgres.conf file, look for the line that defines the socket, and edit this line with the path /var/run/postgresql

    
05.06.2014 / 22:30