2

I was trying to create a rails project with postgresql

I use this

>>rails new ReadingList --database=postgresql
>>rails s 

However, it shows this error enter image description here

Then, I jump to psql and create readinglist_development by myself, but it still show the same error.

4
  • How did you create your database? have you tried doing rake db:create:all? Commented Jul 31, 2015 at 7:48
  • Your Rails is looking for ReadingList_development rather than readinglist_development. Check your database.yml in the config directory to change the database name. Commented Jul 31, 2015 at 7:48
  • yes, database: ReadingList_development is written in database.yml Commented Jul 31, 2015 at 10:46
  • type rake db:create is ok, what is the parameter :all? Commented Jul 31, 2015 at 10:48

2 Answers 2

3

In Rails practice, run rake db:create to create the database after creating new Rails project.

I believe the name of the database(readinglist_development) is not matching the database name of ReadingList_development as in database.yml which Rails does not recognize the database created using psql.

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

1 Comment

yeah, you have been a great help. I figure it out.
0

Its better not to create databases form db workbenches, better to use rails db commands.

1 Comment

Thanks for you advice, I will use rails db command next time.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.