Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails / MySQL2: Error - Unknown database

I'm following a basic tutorial in Linda. I have been able to install everything properly now, but when I start my Rails server I get this message when I visit localhost:3000:

Unknown database 'simple_cms_development'

and then

Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.0ms)
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (23.5ms)
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (29.8ms)
like image 917
KidKola Avatar asked Apr 22 '11 11:04

KidKola


3 Answers

Have you created the database in MySQL? You should be able to run rake db:create and have Rails create it for you.

like image 51
dnch Avatar answered Nov 13 '22 08:11

dnch


I had the same error, please run the following command on the Command Prompt:

rake db:create 

to solve the problem.

like image 16
sami Avatar answered Nov 13 '22 06:11

sami


Look for the answers of these questions:

  1. Have you installed the mysql2 gem?
  2. Is it mentioned in your Gemfile?
  3. Did you run the command rake db:create ?
like image 5
Jatin Ganhotra Avatar answered Nov 13 '22 06:11

Jatin Ganhotra