undefined method `session='+??

I bought AWDWR 2nd edition by Dave Thomas. I downgraded to rails 1.2.1
sudo gem install --source http://gems.rubyforge.org rails -v 1.2.1

I inserted the following line in environment.rb
#RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION

I followed each and every line of the book until p.67/p.68. I started
the server. I got the following errors.
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)

=> Rails application starting on

=> Call with -d to detach

=> Ctrl-C to shutdown server

** Starting Mongrel listening at

** Starting Rails with development environment...


`send': undefined method `session=' for ActionController::Base:Class


/usr/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/initializer.rb:327:in `each'


/usr/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/initializer.rb:324:in `each'



/usr/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/initializer.rb:43:in `send'

/usr/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/initializer.rb:43:in `run'

         ... 27 levels...



/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'

        from script/server:3

What is wrong with my copying work?
Thanks for your help.

I'm guessing the app itself was generated with rails 2.0.x, which means that the generated environment.rb and boot.rb will contain 2.0 specific things. You're probably best off running
rails _1.2.1_ my_app_name to generate you a fresh 1.2.1 rails application.