"Expected #{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/class_methods.rb to define ClassMethods e


I struggled with this error:
"Expected #{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/
class_methods.rb to define ClassMethods

for a while after upgrading from rails 1.2.3 to 2.0.2, and although I
seem to have fixed it, I don’t totally understand why it was broken
in the first place.

The error occured anytime I accessed a class that had a call to
acts_as_ferret, either in the console or through the server. I was
able to fix the problem temporarily in the console by doing a “load”
of that file (a “require” didn’t work, as expected).

I seem to have fixed the problem permanently by renaming two files in
the acts_as_solr (I was playing with both solr and ferret) path,
class_methods.rb and instance_methods.rb. So as far as I can tell,
the “require class_methods” in acts_as_ferret (and after fixing that,
the “require instance_methods”) was getting confused as to what file
was actually being required.

I have no real insight into why this started happening when I
upgraded, or why my fix was in fact a fix. Clearly something with the
way files are loaded was in play, but I’d be interested to know which
component of my system was to blame (me, acts_as_ferret, acts_as_solr,
rails, other?). Any thoughts are appreciated.


Not sure and I’m still on rails 1.2.5, but I might have a lead on
tracking this down.

I’ve run into similar problems a few times in the last week after
deploying to my productions servers where I found the ferret index
files weren’t where they should be and then I noticed in my main
directory for the application there was an empty file called ‘index’.
Each time when I deleted this and the restarted my app, everything
worked fine.

Not sure why this situation arises, but that’s how I cleaned it up
each time.