Forum: Ruby on Rails ActionController::Caching::Sweeper not autoloading

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3d6de5277ae7dfb854cb3316eb982df5?d=identicon&s=25 Olly Lylo (Guest)
on 2009-05-08 15:58
(Received via mailing list)
Hi

I've been following this issue on Lighthouse (https://
rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1977-
actioncontrollercachingsweeper-autoloading-is-broken).  I've since
upgraded to 2-3-stable which contain's Josh's fix, but I'm still
seeing the same error:

         `load_missing_constant': uninitialized constant
ActionController::Caching::Sweeper (NameError)

I've tried a variety of fixes as suggested in the Lighthouse comments,
all to no avail.  The only way I can get my app to start is by
replacing:

@@@
class MySweeper < ActionController::Caching::Sweeper
@@@

with

@@@
require 'rails/actionpack/lib/action_controller/caching/sweeper'
class MySweeper < ActionController::Caching::Sweeping::Sweeper
@@@

This is clearly wrong.

Can anyone help?

My environment.rb file is as follows, if this helps?

    Rails::Initializer.run do |config|
      %w(sweepers observers accounting).each do |dir|
        config.load_paths << "#{RAILS_ROOT}/app/#{dir}"
      end
      config.cache_store = :file_store, "#{RAILS_ROOT}/tmp/cache"
      config.active_record.observers = :my_sweeper
      config.active_record.default_timezone = :utc
      config.action_controller.session_store = :active_record_store
      config.action_mailer.default_charset = "utf-8"
    end
This topic is locked and can not be replied to.