Rails Engines and the “A copy of ApplicationController has been removed from the module tree but is still active!” error
Apr 02
This was a beast of an error to get around, but finally I did in a not so clean manner. I’ve been working with Rails Engines and the approach was to make all controllers in my engine path “unloadable” per the last comment in this thread:
http://dev.rubyonrails.org/ticket/6001
Not the cleanest approach, but it will work until I can actually understand the core problem and refactor my code. This should at least buy you some time so that you can focus on creating modular Rails Engines!

I had the same problem. I solved it by adding the line:
config.cache_classes = false
in my config/environments/development.rb file. That had the unfortunate effect of requiring me to restart my development server whenever I wanted to add new changes. I think it’s a cleaner solution, but it definitely causes a lot of trouble when developing.
Okay, but doesn’t that only fix your problem for development purposes? I’m assuming you don’t disable your class cache in a staging or production env. Would love to hear more about what you’re doing and I agree that approach is a hassle during development
Thanks for sharing.
config.cache_classes = false
is in development.rb by default, I guess the Boris means:
config.cache_classes = true
which (seems) fix my issue when mixing authlogic and smerf
Thanks Horace, fixed mine to mixing authlogic, facebook, and refinery… is annoying though and feels like a bodge.