I'm using MacOSX Lion, ruby 1.9.2, Rails 3.1.2 and postgres 9.0.4
I did a rake db:migrate on my app using postgres. It failed with access denied error.
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
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"?
I have checked whether server is running and it is running ok. I could connect successfully to my db using
psql -Umyuser myapp_development
psql -Umyuser myapp_test
While creating a new PG user, it never asked me for a password and so I didn't give password for that user myuser
anywhere.
Here is my database.yml file.
development:
adapter: postgresql
encoding: utf8
database: myapp_development
username: pgguy
test:
adapter: postgresql
encoding: utf8
database: myapp_test
username: pgguy
production:
adapter: postgresql
encoding: utf8
database: myapp_production
what should I do to connect to it from my rails app?