1
votes

When i run rake db:migrate i get this error:

rake aborted! could not connect to server: Permission denied Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

Any suggestions?

This is my database.yml file:

2
show your database.yml file - vijikumar
i think your postgres server is running in different port instead of 5432. please check this and let me know - vijikumar

2 Answers

1
votes

The problem is that your rails application is trying to connect to the database, by using the configuration that you have on config/database.yml

It seems that you have configured a connection to a PostgreSQL but that the rails application cannot connect so it throws that error.

Check that you have the right credentials on config/database.yml and make sure postgresql is running.

0
votes

Whenever you get the error like this check if something went wrong as:

Probably the host is not added.

Adding host to database.yml file -

development:
  adapter: postgresql
  encoding: utf8
  database: myapp_development
  username: myuser
  host: localhost

test:
  adapter: postgresql
  encoding: utf8
  database: myapp_test
  username: myuser
  host: localhost

production:
  adapter: postgresql
  encoding: utf8
  database: myapp_production