What a coincidence (or sign that our community is big): I was fighting
the same problem yesterday.
I found that I could more reliably track the root cause by leaving
config.cache_classes alone and instead settting
config.reload_plugins = true if RAILS_ENV == 'development'
***in environment.rb (not in development.rb***
I resolved my problem by cleaning up plugin code to do less "require"
and more auto-loading. I moved/renamed files to match Rails'
For testing, use the console and try "reload!" I was fortunate in
that I would get a shower of sparks every time I tried "reload!" until
things were clean. Once cleaned, I reset reload_plugins to false
(just deleted the above line actually).
Also, there is a high correlation between the "Can't dup NilClass"
error and the "A copy of XX has been removed from the module tree but
is still active!" In my case, solving one solved the other. And
which one appeared had something to do with the config settings.