Thanks Bruno,

Unfortunately the nil:NilClass problem was still happening, so I spent
a *bunch* of time investigating the problem yesterday.  It turns out
using "require" in general is a very bad idea except for gems and core
ruby libraries.  The two symptoms I was seeing was A) the nil:NilClass
error on production and B) the error "Help: A copy of <SomeClass> has
been removed from the module tree but is still active!".  Originally I
had thought these two problems to be unrelated, since the first
happened on production, and the latter in dev mode.

In my setup I used "require" to _extend_ the User controller in two
places, and "require_dependency" to _override_ ther User controller in
another.  When I changed everything to use "require_dependency"
instead, both errors went away.

This was a HUGE stumbling block for me, so hopefully by posting this
on the CE group this will save someone else some time and suffering.
Unfortunately, require_dependency is very poorly documented in RoR...
even though this is what you should be using!  Reference below.

-bobics

http://spacevatican.org/2008/9/28/required-or-not
per the article:
"   * Just don't require stuff. If you lets Rails' automagic loading
do its work none of this will happen
    * If you do need to require stuff explicity, use
require_dependency. This means that Rails is kept in the loop"
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CommunityEngine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/communityengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to