RailsApps / rails_apps_composer

A gem with recipes to create Rails application templates for Rails starter apps.
http://railsapps.github.io/rails_apps_composer/
1.42k stars 306 forks source link

Couldn't create PG Database. Getting the error attached below. #186

Open PatGW opened 11 years ago

PatGW commented 11 years ago

"Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"career_development", "pool"=>5, "username"=>"career_development", "password"=>"password", "template"=>"template0"} could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?"

Postgres is definitely running on 5432 so not sure what the issue here is.

Any help appreciated!

rceee commented 11 years ago

Sometimes, depending on how Postgres is installed and running, it may be running via a Unix socket or TCP socket; Rails tries a Unix socket by default. If it isn't there, you get the error above.

Refer to this thread: http://stackoverflow.com/questions/10263821/rails-rake-dbcreateall-fails-to-connect-to-postgresql-database

Try adding the following to your database.yml entry under the development adapter:

host: localhost
port: 5433