# ActionController::Caching::Sweeper not autoloading

**URL:** <https://www.ruby-forum.com/t/actioncontroller-sweeper-not-autoloading/167502>\
**Category:** Rails\
**Created:** [May 8, 2009, 3:58pm UTC](https://www.ruby-forum.com/t/actioncontroller-sweeper-not-autoloading/167502 "2009-05-08T15:58:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olly\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/eb8c5e/32.png) [@Olly\_L](https://www.ruby-forum.com/u/Olly_L)\
**Post date:** [May 8, 2009, 3:58pm UTC](https://www.ruby-forum.com/t/actioncontroller-sweeper-not-autoloading/167502/1 "2009-05-08T15:58:23Z")

</div>

Hi

I’ve been following this issue on Lighthouse (https://  
[rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1977-](http://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

```
