# Edge rails config.cache\_classes = true breaks applications

**URL:** <https://www.ruby-forum.com/t/edge-rails-config-cache-classes-true-breaks-applications/147635>\
**Category:** Rails\
**Created:** [September 3, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/edge-rails-config-cache-classes-true-breaks-applications/147635 "2008-09-03T20:39:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zecko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/9de053/32.png) [@zecko](https://www.ruby-forum.com/u/zecko)\
**Post date:** [September 3, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/edge-rails-config-cache-classes-true-breaks-applications/147635/1 "2008-09-03T20:39:29Z")

</div>

when using current edge rails, i am getting trouble when using the  
production environment – i tracked down the problem to the following  
line

config.cache\_classes = true

if i disable the class caching, everything works just fine, when  
enabling the cache\_classes, lots of errors get dropped – see the output  
below:

error #1:

/Users/zecko/GIT/myapp/vendor/rails/activerecord/lib/active\_record/base.rb:1742:in  
`method_missing_without_paginate': undefined method`file\_field’ for  
#Class:0x36b049c (NoMethodError)  
from  
/Users/zecko/GIT/myapp/vendor/plugins/will\_paginate/lib/will\_paginate/finder.rb:164:in  
`method_missing' from /Users/zecko/GIT/myapp/app/models/carsa_club.rb:117 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in`gem\_original\_require’  
from /Library/Ruby/Site/1.8/rubygems/custom\_require.rb:27:in `require' from /Users/zecko/GIT/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:148:in`require’  
from  
/Users/zecko/GIT/myapp/vendor/rails/activesupport/lib/active\_support/dependencies.rb:507:in  
`new_constants_in' from /Users/zecko/GIT/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:148:in`require’  
from  
/Users/zecko/GIT/myapp/vendor/rails/activesupport/lib/active\_support/dependencies.rb:254:in  
`require_or_load' ... 21 levels... from /Library/Ruby/Gems/1.8/gems/thin-0.8.1/lib/thin/runner.rb:136:in`run!’  
from /Library/Ruby/Gems/1.8/gems/thin-0.8.1/bin/thin:6  
from /usr/bin/thin:19:in `load’  
from /usr/bin/thin:19

when i comment out the parts with “file\_field” i keep getting the  
following errors:

/Users/zecko/GIT/myapp/vendor/rails/activerecord/lib/active\_record/base.rb:1742:in  
`method_missing_without_paginate': undefined method`demo\_mode?’ for  
#Class:0x373bfec (NoMethodError)  
from  
/Users/zecko/GIT/myapp/vendor/plugins/will\_paginate/lib/will\_paginate/finder.rb:164:in  
`method_missing' from /Users/zecko/GIT/myapp/app/models/event.rb:39 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in`gem\_original\_require’  
from /Library/Ruby/Site/1.8/rubygems/custom\_require.rb:27:in `require' from /Users/zecko/GIT/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:148:in`require’  
from  
/Users/zecko/GIT/myapp/vendor/rails/activesupport/lib/active\_support/dependencies.rb:507:in  
`new_constants_in' from /Users/zecko/GIT/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:148:in`require’  
from  
/Users/zecko/GIT/myapp/vendor/rails/activesupport/lib/active\_support/dependencies.rb:254:in  
`require_or_load' ... 21 levels... from /Library/Ruby/Gems/1.8/gems/thin-0.8.1/lib/thin/runner.rb:136:in`run!’  
from /Library/Ruby/Gems/1.8/gems/thin-0.8.1/bin/thin:6  
from /usr/bin/thin:19:in `load’  
from /usr/bin/thin:19

demo\_mode? is a method that checks if the rails env is either  
development or staging.  
everything just works fine with rails 1.2, 2.0 and 2.1 …

any ideas?

thanks a lot!

-zecko

---

<div class="post-metadata">

**Author:** ![zecko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/9de053/32.png) [@zecko](https://www.ruby-forum.com/u/zecko)\
**Post date:** [September 17, 2008, 7:23pm UTC](https://www.ruby-forum.com/t/edge-rails-config-cache-classes-true-breaks-applications/147635/2 "2008-09-17T19:23:47Z")

</div>

Any progress?

These seem to be related:

[http://dev.rubyonrails.org/ticket/10896](http://dev.rubyonrails.org/ticket/10896)  
[http://dev.rubyonrails.org/ticket/10722](http://dev.rubyonrails.org/ticket/10722)

> **[\#115 Caching in Rails 2.1 - RailsCasts](http://railscasts.com/episodes/115-caching-in-rails-2-1)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

[http://zilkey.com/2008/7/5/rails-cache-memcached-development-mode-and-offline-cache-invalidation](http://zilkey.com/2008/7/5/rails-cache-memcached-development-mode-and-offline-cache-invalidation)

But I still haven’t seen a definitive solution.
