Rails 2.3.4 - can't find method `cache_template_extensions'

I've come up with an unusual problem right after installing Ruby+RoR.
When I start server or console, I get these two errors:

C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in
`send': undefined method `cache_template_extensions=' for
ActionView::Base:Class (NoMethodError)
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:443:in
`load_missing_constant':NameError: uninitialized constant
ApplicationController

I see that "cache_template_extensions" defined to 'false' in
environments/development.rb, so I added to environment.rb
ENV['RAILS_ENV'] ||= 'development' just to make sure. (Even though
initializer.rb sets it to 'development' by default anyway).

This is latest Ruby 1.8.6 and RoR 2.3.4 on a Windows Vista 64-bit
desktop.
I copied a small project that I was developing on another WinXP machine
here and tried to start WEBrick with ruby script/server.

The project was originally done under InstantRails, which is based on
RoR 2.0.2.
So I updated to: RAILS_GEM_VERSION = '2.3.4' unless defined?
RAILS_GEM_VERSION

None of this helps.
When I start the console, I get those two messages, but the console
starts.
When I try to start a server (WEBrick), I get this full stack and it
stops.

c:\Ruby\rails_apps\logbook>ruby script/server
=> Booting WEBrick
=> Rails 2.3.4 application starting on http://0.0.0.0:3000
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in
`send': undefined method `cache_template_extensions=' for
ActionView::Base:Class (NoMethodError)
        from
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in
`initialize_framework_settings'
        from
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:601:in
`each'
        from
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:601:in
`initialize_framework_settings'
        from
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:598:in
`each'
        from
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:598:in
`initialize_framework_settings'
        from
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:155:in
`process'
        from
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in
`send'
        from
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in
`run'
         ... 6 levels...
        from
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:84
        from
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
        from
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
        from script/server:3

Hi, in short, caching is disabled in development mode by default. Otherwise, you can

enable it as needed. Usually, it might be better to creating another environment file like

staging or start your application in production mode. Next, you’ll need to perform the

following when changing the RAILS_GEM_VERSION:

rake rails:update

Give this a try and let us know how it goes.

-Conrad

I've come up with an unusual problem right after installing Ruby+RoR.
When I start server or console, I get these two errors:

C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in
`send': undefined method `cache_template_extensions=' for
ActionView::Base:Class (NoMethodError)
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/depen dencies.rb:443:in
`load_missing_constant':NameError: uninitialized constant
ApplicationController

I see that "cache_template_extensions" defined to 'false' in
environments/development.rb, so I added to environment.rb
ENV['RAILS_ENV'] ||= 'development' just to make sure. (Even though
initializer.rb sets it to 'development' by default anyway).

cache_template_extensions is a setting that was removed from rails -
you need to stop trying to set it. Another change was that
ApplicationController used to be found in application.rb but with 2.3
it is expected to be in application_controller.rb (looks like rake
rails:update has done that bit for you)

Fred

Frederick Cheung wrote: