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 methodcache_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 methodcache_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:ineach’
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:ineach’
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:inprocess’
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:inrun’
… 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:inrequire’
from script/server:3


How can I make it work?

Thank you!
MikeL

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

On Sun, Oct 25, 2009 at 7:57 PM, Michael Li <

Conrad T. wrote:

Hi, in short, caching is disabled in development mode by default.
It’s OK to be disabled for now.

Next, you’ll need

to perform the following when changing the RAILS_GEM_VERSION:

rake rails:update

Below is the trace. The problem is still the same. The only difference
is that now the error log of script/console prints only the top
exception message, while before it would print first two. The server
error log is the same.

C:\Ruby\rails_apps\logbook>rake rails:update --trace
(in C:/Ruby/rails_apps/logbook)
** Invoke rails:update (first_time)
** Invoke rails:update:scripts (first_time)
** Execute rails:update:scripts
install -c -m 0755
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/tasks/…/…/bi
n/dbconsole script/dbconsole
** Invoke rails:update:javascripts (first_time)
** Execute rails:update:javascripts
** Invoke rails:update:configs (first_time)
** Execute rails:update:configs
** Invoke rails:update:application_controller (first_time)
** Execute rails:update:application_controller
C:/Ruby/rails_apps/logbook/app/controllers/application.rb has been
renamed to C:
/Ruby/rails_apps/logbook/app/controllers/application_controller.rb,
update your
SCM as necessary
** Execute rails:update

Thank you for helping me out… What is happening?

Mike

Frederick C. wrote:

On Oct 26, 2:57�am, Michael Li [email protected]
wrote:

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

Yes, took it out of development.rb and it worked!!
It all makes sense now. Thank you Fred and Conrad.
Hope this helps other guys migrating off InstantRails 2.0.

With much respect,
Michael

On Oct 26, 2:57 am, Michael Li [email protected]
wrote:

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs