1

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 Commented Dec 5, 2012 at 9:20
  • i think your postgres server is running in different port instead of 5432. please check this and let me know Commented Dec 5, 2012 at 10:15

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.