I am reading “Agile Web Development with Rails, 2nd Edition”, which is based on 1.2.6. However, on my Leopard based iMac, I was running Rails 2.2.2.
When I got to the part with associating a scaffold to my :products (located on the bottom of page 67), it outputted a No Scaffold method error (because scaffolds are not included in 2.2.2).
After searching some web sites, particularly <http://www.ruby- forum.com/topic/137274>, I tried to install 1.2.6 by issuing: gem install rails—version 1.2.6—include-dependencies.
This worked correctly, but when I still type check the current version from bash it states:
Rails 2.2.2
I then went into my app’s config/environment.rb file and set RAILS_GEM_VERSION to 1.2.6.
When I tried to re-start the WEBrick server, I got the following error:
=> Booting WEBrick… ./script/../config/../config/environment.rb:46: undefined method `time_zone=’ for #<rails::configuration:0x11600c0> (NoMethodError) from /Users/untz/.gem/ruby/1.8/gems/rails-1.2.6/lib/initializer.rb: 45:in `run’ from ./script/../config/../config/environment.rb:13
On line 46, on my WEBrick server, this is what is set:
config.time_zone = ‘UTC’
Question(s):
(1) Should I stick with learning Rails 2.2.2 and upgrade to Ruby 1.9?
(2) Is the 2nd Edition of this book now deprecated or is there a workaround to my problem?
(3) Any good resources on learning the new version of Rails?
Happy programming!