Spitting the dummy…

Well, I’ve made good progress, but stuck when arriving at p182. Part III: real Rails. Listing 9-2 on the next page has a ‘require_gem…’ at the start of the page and try as I may i can’t get past this. My setup is warning me that this is deprecated and/or not a recognised method. If I remove the line I get  ’uninitialized constant ActiveRecord (NameError) ’ so clearly something is wrong. I thought I’d plough on and see if I could fix it up later but the following examples (i.e. p190, Listing 9-3 require this to build on.So after much tinkering and Googling I’ve drawn a blank and close to spitting the dummy. How many times have I purchased ‘Dummies’ books only to run into road blocks like this. It seems that once a book is published it’s forgotten and almost certain to not have working examples as soon as the code it relies on moves on aversion or two.Not good… It is strangely comforting to see other people falling at the same hurdle…

This entry was posted in Code. Bookmark the permalink.

2 Responses to Spitting the dummy…

  1. Greg says:

    Change the first line of my_ruby_code.rb

    require_gem "activerecord"

    to

    require "active_record"

    This worked for me

    See: http://dev.rubyonrails.org/ticket/8845

  2. David says:

    Thanks Greg :-)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>