# "Expected #{RAILS\_ROOT}/vendor/plugins/acts\_as\_ferret/lib/class\_methods.rb to define ClassMethods e

**URL:** <https://www.ruby-forum.com/t/expected-rails-root-vendor-plugins-acts-as-ferret-lib-class-methods-rb-to-define-classmethods-e/127236>\
**Category:** Rails\
**Created:** [January 26, 2008, 7:27pm UTC](https://www.ruby-forum.com/t/expected-rails-root-vendor-plugins-acts-as-ferret-lib-class-methods-rb-to-define-classmethods-e/127236 "2008-01-26T19:27:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbennett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c0e974/32.png) [@bbennett](https://www.ruby-forum.com/u/bbennett)\
**Post date:** [January 26, 2008, 7:27pm UTC](https://www.ruby-forum.com/t/expected-rails-root-vendor-plugins-acts-as-ferret-lib-class-methods-rb-to-define-classmethods-e/127236/1 "2008-01-26T19:27:29Z")

</div>

Hi,

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.

Brad

---

<div class="post-metadata">

**Author:** ![bbennett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c0e974/32.png) [@bbennett](https://www.ruby-forum.com/u/bbennett)\
**Post date:** [January 26, 2008, 9:51pm UTC](https://www.ruby-forum.com/t/expected-rails-root-vendor-plugins-acts-as-ferret-lib-class-methods-rb-to-define-classmethods-e/127236/2 "2008-01-26T21:51:49Z")

</div>

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.
