I want to create a rails api and wanting to migrate the database. I have started postgresql with the following command brew services restart postgresql
. The console gave me the following response ==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql)
. The problem is when I run rails db:migrate I get the following error
rails db:migraterails aborted!
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 help would be appreciated. I did try the following link PG::ConnectionBad - could not connect to server: Connection refused
This did not seem to work.