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:
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
"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...@gmail.com> 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/...
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/.