Myron Marston
2007-May-13 13:54 UTC
A copy of Controller has been removed from the module tree but is still active!
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/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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Myron Marston
2007-May-19 02:48 UTC
Re: A copy of Controller has been removed from the module tree but is still active!
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? On May 13, 9:54 pm, Myron Marston <myron.mars...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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/... > > http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/... > > 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Eliot Sykes
2009-Oct-29 11:43 UTC
Re: A copy of Controller has been removed from the module tr
> "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/ -- Posted via http://www.ruby-forum.com/.