Forum: Ruby on Rails A copy of Controller has been removed from the module tree b

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
42d4590355a1404230fbc9aff4dd377b?d=identicon&s=25 Myron Marston (Guest)
on 2007-05-13 15:55
(Received via mailing list)
Something is screwed up with the way Rails is loading my controllers.
I get the following error for one of my controllers:

ArgumentError in My content pagesController#edit
A copy of Goldberg::ContentPagesController has been removed from the
module tree but is still active!

active_support/dependencies.rb:237:in `load_missing_constant'
active_support/dependencies.rb:468:in `const_missing'

If I restart my server, I can perform a single action on the
controller, and then I get this error again on the following action.
I've done some searching, and found that others have had the same

Earlier in the week I had this problem with a bunch of my other
controllers, and I fixed it by following the advice at these threads.
I added the following line to my environment.rb:

config.load_once_paths += %W{ #{RAILS_ROOT}/app/controllers }

That fixed it for all the other controllers, but not for this one.
One difference with this controller is that I've subclassed it.  I'm
using the Goldberg plugin, and I wanted to add some functionality to
the way content pages work.  I wanted to touch the plugin code as
little as possible to facilitate future upgrades, so I created
MyContentPagesController, subclassed from
Goldberg::ContentPagesController, and modified the routings to make
sure my subclass gets used.  I tried to fix the problem by adding the
path for Goldberg::ContentPagesController to load_once_paths, but that
didn't make any difference.

Anyone got any ideas for how to fix this?  In case it matters, I'm
using Rails 1.2.3.

42d4590355a1404230fbc9aff4dd377b?d=identicon&s=25 Myron Marston (Guest)
on 2007-05-19 04:55
(Received via mailing list)
No one has any ideas for this?  For now I've been working around this
by restarting my server as necessary.  However, this morning, I'm
getting the same error for ApplicationHelper:

"A copy of ApplicationHelper has been removed from the module tree but
is still active!"

I get this error every time I access any page.  My only work around
for the moment is to run in production mode, but that's not the best
way to develop, for obvious reasons.

Can anyone help me?
366e43b0a2b17de75802f2830d4f5be3?d=identicon&s=25 Eliot Sykes (eliot)
on 2009-10-29 12:43
> "A copy of ApplicationHelper has been removed from the module tree but
> is still active!"

At the top of your helper, try 'require'-ing any modules and classes you
use in it. See this blog post for an example:
This topic is locked and can not be replied to.