Women in Technology

Hear us Roar



Article:
  Rolling with Ruby on Rails
Subject:   error
Date:   2006-02-22 08:24:27
From:   pacodc
Hi,


-I get an error after the step described on page 3:


"Open a command window in the cookbook directory (c:\rails\cookbook) and run the command:


ruby script\generate controller RecipeThis will create a file named recipe_controller.rb containing a skeleton definition for the RecipeController class. Right-click on this file, choose Edit, and add the line scaffold :recipe as shown in Figure 31."


-After doing that, i get this error:


"Mysql::Error in Recipe#new
#42000Unknown database 'cookbook_development'
RAILS_ROOT: ./script/../config/.."


What am i doing wrong??


Thanks,
paco


Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Curt Hibbs photo error
    2006-02-22 09:47:35  Curt Hibbs | O'Reilly AuthorO'Reilly Blogger [View]

    From the error message you posted, it looks like when you edited database.yml to tell Rails the name of your database, you used the database name "cookbook_development". This is fine. Just make sure the name matches exactly with the name of the database you created in MySQL. If, for example, you had actually named your database "cookbook" as I did in the tutorial, then you would get this error.
    • error
      2006-04-28 09:17:47  bwl [View]

      If you've made the change to database.yml and still see this error see if you are still running the server.

      Restarting the server will pick up the change.

      ruby script\server