Cookbook2 question (cookbook2_developement)

I am new to Ruby on Rails and I was doing the tutorial, everything is
fine until I add the scaffold and then run the app
(http://127.0.0.1:3000/recipe/new)

I get this error : #42000Unknown database ‘cookbook2_development’

I did all the steps from the tutorial though, and did remove the
“_development” from the database.yml file.

Now, if I change my database name to cookbook2_development it works.

I looked also at all the file from the project and I never found the
“_development”.

Is there something I am missing here?

Thanks for any help.

Patrice Fiset wrote:

I am new to Ruby on Rails and I was doing the tutorial, everything is
fine until I add the scaffold and then run the app
(http://127.0.0.1:3000/recipe/new)

I get this error : #42000Unknown database ‘cookbook2_development’

I did all the steps from the tutorial though, and did remove the
“_development” from the database.yml file.

Now, if I change my database name to cookbook2_development it works.

I looked also at all the file from the project and I never found the
“_development”.

Is there something I am missing here?

Thanks for any help.

Have you restarted your development web server yet? If you change
databases or database credentials the web server must be restarted. Let
me know if that fixes your problem or if I misunderstood.

~Jimmy

Hi Patrice,

Is there something I am missing here?

There are two components here: 1) the database and 2) database.yml.

Your database.yml file tells Rails, per mode (dev|test|prod), the name
of
the database to use. If Rails can’t find the database you tell it to
use
(per the database.yml file) then it will give you the error you saw.

If I read your description correctly, the behavior above says that Rails
can find a database named “cookbook2_development” but can not find a
database named just “cookbook2”. Do you see something different when
you
look at the database server?

hth,
Bill

If you edited database.yml and didn’t restart the server, your
changed won’t have taken effect. Try restarting the server and see
what happens.