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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Aug 26, 9:22 am, Justus Ohlhaver <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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:ModuleSounds like you''ve got something else called Cluster that is only loaded sometimes but which shadows your model when it is loaded Fred> > --- > > 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 > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On Aug 26, 9:22�am, Justus Ohlhaver <rails-mailing-l...@andreas-s.net> > 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 > > FredHello 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 26 Aug 2008, at 09:41, Justus Ohlhaver wrote:> > Frederick Cheung wrote: >> On Aug 26, 9:22�am, Justus Ohlhaver <rails-mailing-l...@andreas- >> s.net> >> 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. JustusThat''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> > > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
>> >> 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. > > FredDear Fred, Thanks so much for your help! That solved the problem. Justus -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---