3

So, had a working postgres db instance with my rails app on my development Mac, but the migrations were getting unmanageable as I'm building the model up from scratch (i.e. adding, removing, changing columns), so I decided to start clean. After running rake db:drop, I can not recreate via rake db:create. I simply get the following:

Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"xyz_development", "pool"=>5, "username"=>"xyz", "password"=>nil}

I am thinking I need to create the user in postgres, but shouldn't it be there from initial setup?

Thanks.

1
  • You should show us the real SQL error that was thrown in the background. Apr 15, 2012 at 7:35

2 Answers 2

1

You should see the SQL statement to create the database in the log output, and probably also the error. Check that.

Also check that the database doesn't already exist. Try creating the database manually using psql(1) with the username/password you use in rails and see what happens.

0
$ createdb xyz_development

Use the postgres bin createdb

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.