# Rails 2.3.4 - can't find method \`cache\_template\_extensions'

**URL:** <https://www.ruby-forum.com/t/rails-2-3-4-cant-find-method-cache-template-extensions/177876>\
**Category:** Rails\
**Created:** [October 26, 2009, 3:57am UTC](https://www.ruby-forum.com/t/rails-2-3-4-cant-find-method-cache-template-extensions/177876 "2009-10-26T03:57:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [October 26, 2009, 3:57am UTC](https://www.ruby-forum.com/t/rails-2-3-4-cant-find-method-cache-template-extensions/177876/1 "2009-10-26T03:57:37Z")

</div>

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](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

* * *

How can I make it work?

Thank you!  
MikeL

---

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [October 26, 2009, 4:50am UTC](https://www.ruby-forum.com/t/rails-2-3-4-cant-find-method-cache-template-extensions/177876/2 "2009-10-26T04:50:32Z")

</div>

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 \<

---

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [October 26, 2009, 5:21am UTC](https://www.ruby-forum.com/t/rails-2-3-4-cant-find-method-cache-template-extensions/177876/3 "2009-10-26T05:21:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [October 26, 2009, 9:37am UTC](https://www.ruby-forum.com/t/rails-2-3-4-cant-find-method-cache-template-extensions/177876/4 "2009-10-26T09:37:08Z")

</div>

Frederick C. wrote:

> On Oct 26, 2:57ï¿½am, Michael Li [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> 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

---

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [October 26, 2009, 9:16am UTC](https://www.ruby-forum.com/t/rails-2-3-4-cant-find-method-cache-template-extensions/177876/5 "2009-10-26T09:16:15Z")

</div>

On Oct 26, 2:57 am, Michael Li [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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
