Rails: rake db:create:all (could not connect to server)

橙三吉。 提交于 2019-12-01 09:05:12

[update2]

okay, This is what you should do:

  1. the unix socket should be at /var/pgsql_socket(as per the plist image) where as rails is trying to find the socket file in /tmp. I believe this is the reason for error. so Edit your database.yml & explicitly add socket location. so your final database.yml should look like this. change the file location for your unix socket location. try to connection now?

2) If it still doesn't connect. verify that postgres server is actually running

$ netstat -a | grep postgre

if its running, try connecting to it from terminal using psql command. incase its, not running. try starting it manually

pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

If it still doesn't start, Are there any error messages in the server.log? If yes do post them here.

Good luck! =======UPDATED===============

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!