Q:

Rails can't do nothing on launch => PGSQL.5432 error

hello i have this line prompt to terminal when i try to drop or create db for an old project ? 
It's a rails project 
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”?

any advices ?  

A:

:-)
i do that when i have that problem 
it suppose that u r using homebrew
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
rm -rf /usr/local/var/postgres
initdb -E utf8 /usr/local/var/postgres
/usr/local/opt/postgresql/bin/postgres  -D /usr/local/var/postgres
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
rails db:create

let run the thing then command +  C and do again rails db:create

