简体   繁体   中英

Connection error at the db creation

I have a rails project, that works with postgresql and pg. I installed postgres in my computer, but when I try to create/migrate the db of the aplication, I get the following error:

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

I created already the user for the application. I didn't have the postgresql folder at least, I had to create it. What could be the problem?

I'm using Ubuntu 14.04

By default the socket connection file is located in the /tmp folder, you can find it in /tmp/.s.PGSQL.5432. To change the location check ~/.parts/var/postgresql/postgresql.conf file, but /var/run directory is not writable now, you can't select /var/run as the socket file location.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM