Rails: rake db: create: all (failed to connect to server)

follow screencasts http://railscasts.com/episodes/342-migrating-to-postgresql?autoplay=true up to the steps "rake db: create: all" and get the error:

failed to connect to the server: such a file or directory is not a server running locally and accepts connections in the Unix socket domain "/tmp/.s.PGSQL.5432"?

refers to a Rails question : rake db: create: all cannot connect to a PostgreSQL database

but still cannot solve it. Not sure what the problem is. enter image description here

[database.yml]

development:
  adapter: postgresql
  encoding: unicode
  database: store_development
  pool: 5
  username: amysukumunu 
  password:
test:
  adapter: postgresql
  encoding: unicode
  database: store_test
  pool: 5
  username: amysukumunu
  password: 
+3
source share
1 answer

[Update2]

, , :

  • Unix- /var/pgsql_socket ( plist), /tmp. , . database.yml . database.yml this. unix. ?

2) . , postgres

$ netstat -a | grep postgre

, psql. , .

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

, server.log? , .

! ======= =============== enter image description hereenter image description here

+4

All Articles