# Cache\_classes = true causes application to fail

**URL:** <https://www.ruby-forum.com/t/cache-classes-true-causes-application-to-fail/174426>\
**Category:** Rails\
**Created:** [August 26, 2009, 6:06pm UTC](https://www.ruby-forum.com/t/cache-classes-true-causes-application-to-fail/174426 "2009-08-26T18:06:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://www.ruby-forum.com/u/steve)\
**Post date:** [August 26, 2009, 6:06pm UTC](https://www.ruby-forum.com/t/cache-classes-true-causes-application-to-fail/174426/1 "2009-08-26T18:06:10Z")

</div>

Hi,

I am using rails 2.3.2, apache 2.2, active scaffold, and mongel. I  
was caught by surprise when an application that was working started to  
fail. Digging into things showed that the error occurred when  
cache\_classes = true (even though it worked this way before, setting  
cache\_class to false now fixed the problem). Naturally, this is not  
an actual fix for a production application, as it has slowed way  
down. I have seen in other posts that people had problems with  
running rake in production with active scaffold, but have not seen  
others with this problem, where the web server fails to start. Does  
anyone know any more information about cache\_classes? Since it seems  
to work then the code keeps getting reloaded, is it possible that I  
need to manually clear this cache somewhere? Could this problem be  
related to Active Scaffold? Thank you for any information!

Steve

---

<div class="post-metadata">

**Author:** ![steve](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://www.ruby-forum.com/u/steve)\
**Post date:** [August 26, 2009, 7:22pm UTC](https://www.ruby-forum.com/t/cache-classes-true-causes-application-to-fail/174426/2 "2009-08-26T19:22:56Z")

</div>

On 26 Aug 2009, at 16:26, Steve wrote:

> running rake in production with active scaffold, but have not seen  
> others with this problem, where the web server fails to start. Does  
> anyone know any more information about cache\_classes? Since it seems  
> to work then the code keeps getting reloaded, is it possible that I  
> need to manually clear this cache somewhere? Could this problem be  
> related to Active Scaffold? Thank you for any information!

cache\_class=true means (among other things) that code gets loaded up  
front when the application starts.  
One way this can go wrong is at the bottom of

> **[environment.rb and requiring dependencies - Space Vatican](https://www.spacevatican.org/2008/11/21/environment-rb-and-requiring-dependencies/)**
>
> In the before time, the bottom of most of my apps’ environment.rb was an unholy mess. Inflector rules, requiring of various libraries or gems, …

Fred
