# Can't create a new class instance following instructions

**URL:** <https://www.ruby-forum.com/t/cant-create-a-new-class-instance-following-instructions/117683>\
**Category:** Rails\
**Created:** [October 19, 2007, 11:04am UTC](https://www.ruby-forum.com/t/cant-create-a-new-class-instance-following-instructions/117683 "2007-10-19T11:04:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![glynne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a88e57/32.png) [@glynne](https://www.ruby-forum.com/u/glynne)\
**Post date:** [October 19, 2007, 11:04am UTC](https://www.ruby-forum.com/t/cant-create-a-new-class-instance-following-instructions/117683/1 "2007-10-19T11:04:09Z")

</div>

I’m new to ruby On Rails, I’m running InstantRails on a Windows XP Pro.  
SP2 machine. I’m rigorously following the book ‘Build Your Own Ruby On  
Rails Web Applications’ by Patrick Lenz. I’ve reached ch4 without any  
problem at all but on P101:

> > class Story \< ActiveRecord::Base; end  
> > =\>nil #Works fine to here but then:  
> > story = Story.new #This fails with the error:  
> > Error: Unknown database ‘shovell\_development’  
> > plus a number of other ‘from’ lines.  
> > I created the shovell\_development database earlier exactly as the book  
> > instructed & I’ve used the show command in mysql plus manually checking  
> > the relevant folders so I know that the database is there. I know that  
> > some sort of setting must be wrong but I can’t find out where, I’ve  
> > edited the ‘database.yml’ in the shovell config file, that seems to be  
> > OK, I’ve also added the system variable to my environment variables  
> > path as:  
> > Name: mysql Value: Drive:\path\to\mysql\bin  
> > so I’ve now exhausted my possibilities. I can only think that there  
> > must be some setting or other agent responsible for the problem because  
> > otherwise how would ‘story = Story.new’ know to look for the  
> > shovell\_development’ database as the whole command block doesn’t refer  
> > to it at all?  
> > Any help greatly appreciated.  
> > removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![glynne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a88e57/32.png) [@glynne](https://www.ruby-forum.com/u/glynne)\
**Post date:** [October 19, 2007, 11:15am UTC](https://www.ruby-forum.com/t/cant-create-a-new-class-instance-following-instructions/117683/2 "2007-10-19T11:15:36Z")

</div>

On 19 Oct 2007, at 10:04, Glynne Hewlett wrote:

> Name: mysql Value: Drive:\path\to\mysql\bin  
> so I’ve now exhausted my possibilities. I can only think that there  
> must be some setting or other agent responsible for the problem  
> because  
> otherwise how would ‘story = Story.new’ know to look for the  
> shovell\_development’ database as the whole command block doesn’t refer  
> to it at all?

The bit that tells it to look there is the databases.yml file, so I’d  
check that again and/or show us what’s in it.

Fred

---

<div class="post-metadata">

**Author:** ![glynne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a88e57/32.png) [@glynne](https://www.ruby-forum.com/u/glynne)\
**Post date:** [October 19, 2007, 4:03pm UTC](https://www.ruby-forum.com/t/cant-create-a-new-class-instance-following-instructions/117683/3 "2007-10-19T16:03:16Z")

</div>

Frederick C. wrote:

> On 19 Oct 2007, at 10:04, Glynne Hewlett wrote:
> 
> > Name: mysql Value: Drive:\path\to\mysql\bin  
> > so I’ve now exhausted my possibilities. I can only think that there  
> > must be some setting or other agent responsible for the problem  
> > because  
> > otherwise how would ‘story = Story.new’ know to look for the  
> > shovell\_development’ database as the whole command block doesn’t refer  
> > to it at all?
> 
> The bit that tells it to look there is the databases.yml file, so I’d  
> check that again and/or show us what’s in it.
> 
> Fred

Hi Fred, thanks for your prompt reply, I’ve attached the database.yml  
file for inspection but I’ve also found something else out, InstantRails  
is searching for the shovell\_development database in  
/InstantRails/rails\_apps/shovell which is the application structure  
folder it created, but the database was created by InstantRails in  
/InstantRails/mysql/data so now I’m confused as to why InstantRails  
doesn’t know where it craeted its own database?  
Many thanks for any help.  
removed\_email\_address@domain.invalid
