Glynne Hewlett
2007-Oct-19 09:04 UTC
Can''t create a new class instance following instructions.
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. glynne-BBVnCbkra4W9FHfhHBbuYA@public.gmane.org -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Oct-19 09:14 UTC
Re: Can''t create a new class instance following instructions.
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Glynne Hewlett
2007-Oct-19 14:03 UTC
Re: Can''t create a new class instance following instructions.
Frederick Cheung 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. > > FredHi 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. glynne-BBVnCbkra4W9FHfhHBbuYA@public.gmane.org Attachments: http://www.ruby-forum.com/attachment/706/database.yml -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---