Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Rails 2.3 is caching views in development mode

#2356

Ok, I've just upgraded a big application to Rails 2.3 with no major issues to point except for a show-stopper that's consuming too much time. Rails is caching views in development mode.

In an attempt to figure out where's the problem coming from, I created a whole new rails application and views were working fine. Based on that I double-checked the config files. Botch cache_classes and cache_template_loading is set to false in development mode.

I took a sneak at the plugins to see whether one culprit could be causing this. I'm currently using the following plugins:

aasm acts_as_list configurator libmemcached_store smurf workling_mailer action_mailer_tls acts_as_versioned exception_notification paperclip restful_authentication spawn active_scaffold betternestedset globalize2 permalink_fu simple_access_control workling

In order for Rails 2.3 to work I had to update a bunch of them, namely Smurf, ActiveScaffold, mislav-will_paginate (as a gem).

Any ideas what could be causing this issue? In short, so we can nail down the source of this bug, all config files are Ok and don't port any old settings. View caching is explicitly disabled in development mode. I'm using Rails 2.3.2. On a fresh application, everything is ok.

I can run some specific battery of tests if you want me so.

Regards.

Reported by mlopes · March 27th, 2009 @ 11:20 AM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. mlopes
    mlopes

    Forgot to mention, the workaround is restarting Mongrel for Rails to refresh the views...

    March 27th, 2009 @ 11:24 AM

  2. mlopes
    mlopes

    Ok, found the issue. config.threadsafe! was enabled in development mode.

    I don't know whether this is a bug or a feature (threadsafety is not ought to be enabled in dev mode), but it was causing views not to be reloaded in development mode and some other strange behavior as well like controller classes not being found from time to time.

    March 27th, 2009 @ 11:56 AM

  3. thedarkone
    thedarkone

    Constant and view reloading are both not threadsafe, so neither is going to work with config.threadsafe!. Also freshly generated Rails app doesn't contain config.threadsafe! in development.rb at all. No bugs here.

    March 27th, 2009 @ 03:09 PM

  4. CancelProfileIsBroken
    CancelProfileIsBroken
    • State changed from new to invalid

    Agreed. This has been documented in various spots. If you spot somewhere in the RDoc or Guides that we could make it clearer, please submit a ticket on the docrails project.

    March 27th, 2009 @ 03:48 PM

  5. mlopes
    mlopes

    It could be my fault, but it took me several hours to figure this one out. If someone is with me on this one, please open a ticket for a huge warning on the docrails project (probably is a known issues section - something that would get properly indexed on Google while searching for 'rails 2.3 caching views in development mode'.

    March 27th, 2009 @ 03:51 PM