# Undefined method \`find'

**URL:** <https://www.ruby-forum.com/t/undefined-method-find/146870>\
**Category:** Rails\
**Created:** [August 26, 2008, 10:22am UTC](https://www.ruby-forum.com/t/undefined-method-find/146870 "2008-08-26T10:22:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![justus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@justus](https://www.ruby-forum.com/u/justus)\
**Post date:** [August 26, 2008, 10:22am UTC](https://www.ruby-forum.com/t/undefined-method-find/146870/1 "2008-08-26T10:22:41Z")

</div>

Hello,

I have an application with multiple models that works perfectly fine in  
both development and production.

Now I added yet another model & database table ‘Cluster’ - no  
fundamental difference to the other models I added before.

All calls to this model from the regular application on the production  
server  
such as ‘Cluster.find(:last)’ - or any other request that you could  
think of that involves Cluster or clusters - result in:

undefined method `find’ for Cluster:Module

* * *

The strange thing is that this model works perfectly

a.) in development.

b.) through a daemon in production which is populating the Cluster db  
table. (and is using exactly the same code that causes the errors when  
used from the controller or views.)

c.) through the console app on the production server (where I use any  
any command on Cluster)

Also of course the find method works normal everywhere including  
production in for all other models.

So this looks very strange and impossible to solve for me as I am  
relatively new. At the same time I hope that to someone slightly more  
experienced it might be something very obvious and easy to fix.

Thanks a lot in advance for any help or ideas!  
Justus

---

<div class="post-metadata">

**Author:** ![justus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@justus](https://www.ruby-forum.com/u/justus)\
**Post date:** [August 26, 2008, 10:30am UTC](https://www.ruby-forum.com/t/undefined-method-find/146870/2 "2008-08-26T10:30:00Z")

</div>

On Aug 26, 9:22 am, Justus O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> such as ‘Cluster.find(:last)’ - or any other request that you could  
> think of that involves Cluster or clusters - result in:
> 
> undefined method `find’ for Cluster:Module

Sounds like you’ve got something else called Cluster that is only  
loaded sometimes but which shadows your model when it is loaded

Fred

---

<div class="post-metadata">

**Author:** ![justus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@justus](https://www.ruby-forum.com/u/justus)\
**Post date:** [August 26, 2008, 10:41am UTC](https://www.ruby-forum.com/t/undefined-method-find/146870/3 "2008-08-26T10:41:14Z")

</div>

Frederick C. wrote:

> On Aug 26, 9:22ï¿½am, Justus O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > such as ‘Cluster.find(:last)’ - or any other request that you could  
> > think of that involves Cluster or clusters - result in:
> > 
> > undefined method `find’ for Cluster:Module
> 
> Sounds like you’ve got something else called Cluster that is only  
> loaded sometimes but which shadows your model when it is loaded
> 
> Fred

Hello Fred, thanks. The only thing I could think of is the  
mongrel\_cluster. Do you think just renaming the Cluster model everywhere  
into something else could do the trick?  
Thanks. Justus

---

<div class="post-metadata">

**Author:** ![justus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@justus](https://www.ruby-forum.com/u/justus)\
**Post date:** [August 27, 2008, 2:49pm UTC](https://www.ruby-forum.com/t/undefined-method-find/146870/4 "2008-08-27T14:49:15Z")

</div>

> > Hello Fred, thanks. The only thing I could think of is the  
> > mongrel\_cluster. Do you think just renaming the Cluster model  
> > everywhere  
> > into something else could do the trick?  
> > Thanks. Justus
> 
> That’s what it looks like. When running under mongrel my app has a  
> Cluster constant (but not under webrick) and the things in there  
> certainly look mongrel-related.
> 
> Fred

Dear Fred, Thanks so much for your help! That solved the problem. Justus

---

<div class="post-metadata">

**Author:** ![justus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@justus](https://www.ruby-forum.com/u/justus)\
**Post date:** [August 26, 2008, 11:12am UTC](https://www.ruby-forum.com/t/undefined-method-find/146870/5 "2008-08-26T11:12:55Z")

</div>

On 26 Aug 2008, at 09:41, Justus O. wrote:

> > Sounds like you’ve got something else called Cluster that is only  
> > loaded sometimes but which shadows your model when it is loaded
> > 
> > Fred
> 
> Hello Fred, thanks. The only thing I could think of is the  
> mongrel\_cluster. Do you think just renaming the Cluster model  
> everywhere  
> into something else could do the trick?  
> Thanks. Justus

That’s what it looks like. When running under mongrel my app has a  
Cluster constant (but not under webrick) and the things in there  
certainly look mongrel-related.

Fred
