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. Commented 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.

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

Comments

0
$ createdb xyz_development

Use the postgres bin createdb

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.