且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Rails:rake db:create:all(无法连接到服务器)

更新时间:2022-11-30 11:14:31

[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===============