# A copy of Controller has been removed from the module tree b

**URL:** <https://www.ruby-forum.com/t/a-copy-of-controller-has-been-removed-from-the-module-tree-b/104045>\
**Category:** Rails\
**Created:** [May 13, 2007, 3:55pm UTC](https://www.ruby-forum.com/t/a-copy-of-controller-has-been-removed-from-the-module-tree-b/104045 "2007-05-13T15:55:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Myron\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f17d59/32.png) [@Myron\_M](https://www.ruby-forum.com/u/Myron_M)\
**Post date:** [May 13, 2007, 3:55pm UTC](https://www.ruby-forum.com/t/a-copy-of-controller-has-been-removed-from-the-module-tree-b/104045/1 "2007-05-13T15:55:42Z")

</div>

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!

F:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/  
active\_support/dependencies.rb:237:in `load_missing_constant' F:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ 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  
problem:

[http://groups.google.com/group/rubyonrails-talk/browse\_thread/thread/2a07bf5c8bfdae7c/32a8877a9e5ea7e9](http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/2a07bf5c8bfdae7c/32a8877a9e5ea7e9)

[http://groups.google.com/group/rubyonrails-talk/browse\_thread/thread/1155f9ab3a65d8e7/8c128eee5b943efd](http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/1155f9ab3a65d8e7/8c128eee5b943efd)

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.

Thanks,  
Myron

---

<div class="post-metadata">

**Author:** ![Myron\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f17d59/32.png) [@Myron\_M](https://www.ruby-forum.com/u/Myron_M)\
**Post date:** [May 19, 2007, 4:55am UTC](https://www.ruby-forum.com/t/a-copy-of-controller-has-been-removed-from-the-module-tree-b/104045/2 "2007-05-19T04:55:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Myron\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f17d59/32.png) [@Myron\_M](https://www.ruby-forum.com/u/Myron_M)\
**Post date:** [October 29, 2009, 12:43pm UTC](https://www.ruby-forum.com/t/a-copy-of-controller-has-been-removed-from-the-module-tree-b/104045/3 "2009-10-29T12:43:52Z")

</div>

> “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:

[http://blog.eliotsykes.com/2009/10/29/fixing-a-copy-of-applicationhelper-has-been-removed-from-the-module-tree-but-is-still-active/](http://blog.eliotsykes.com/2009/10/29/fixing-a-copy-of-applicationhelper-has-been-removed-from-the-module-tree-but-is-still-active/)
