First off Windows, because actually what I appear to be getting is a Rails error which only occurs when I use Mongrel, using Webrick I do not get this error. I start Mongrel using: mongrel_rails start I have mongrel, win32-services and mongrel-service gems installed even through Im not using mongrel as a service at the moment. The whole application works apart from one action. The error I get is: NoMethodError in SearchController#results undefined method `table_name'' for Stop:Class |(__DELEGATION__):2:in `__send__'' (__DELEGATION__):2:in `table_name'' #{RAILS_ROOT}/app/models/search.rb:58:in `find_runs'' #{RAILS_ROOT}/app/models/search.rb:44:in `depature_runs'' #{RAILS_ROOT}/app/controllers/search_controller.rb:100:in `results''| So my results action gives an error for table_name! The Stop model is used by various other controllers just fine. In Console I can do Stop.find_all, so I dont see how this error is being generated, besides the application server, mongrel, webrick or other, should not have any effect once it palms the request off to dispatcher? Many thanks AFM. PS. The freeBSD error can wait for another time :)
Wow, that''s nasty. What version of mongrel gem are you using? Also, you said on Windows, but which one? What ruby distro are you using? (hope mswin32 of 1.8.4 which is based on VC6, same for One-Click Installer). It is only thrown apart when calling that method? which code contains? (please paste for better understanding of what are you doing that brake so badly). On 9/6/06, Kris Leech <kris at alternativefocusmedia.com> wrote:> First off Windows, because actually what I appear to be getting is a > Rails error which only occurs when I use Mongrel, using Webrick I do not > get this error. > I start Mongrel using: > mongrel_rails start > > I have mongrel, win32-services and mongrel-service gems installed even > through Im not using mongrel as a service at the moment. > > The whole application works apart from one action. The error I get is: > > > NoMethodError in SearchController#results > > undefined method `table_name'' for Stop:Class > > |(__DELEGATION__):2:in `__send__'' > (__DELEGATION__):2:in `table_name'' > #{RAILS_ROOT}/app/models/search.rb:58:in `find_runs'' > #{RAILS_ROOT}/app/models/search.rb:44:in `depature_runs'' > #{RAILS_ROOT}/app/controllers/search_controller.rb:100:in `results''| > > > So my results action gives an error for table_name! The Stop model is > used by various other controllers just fine. In Console I can do > Stop.find_all, so I dont see how this error is being generated, > besides the application server, mongrel, webrick or other, should not > have any effect once it palms the request off to dispatcher? > > > Many thanks AFM. > > PS. The freeBSD error can wait for another time :) > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >-- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi
On Wed, 2006-09-06 at 14:42 +0100, Kris Leech wrote:> First off Windows, because actually what I appear to be getting is a > Rails error which only occurs when I use Mongrel, using Webrick I do not > get this error. > I start Mongrel using: > mongrel_rails start > > I have mongrel, win32-services and mongrel-service gems installed even > through Im not using mongrel as a service at the moment. > > The whole application works apart from one action. The error I get is: > > > NoMethodError in SearchController#results > > undefined method `table_name'' for Stop:ClassMongrel already has created a class called "Stop", so your class is conflicting with it. Basically, Stop, Start, Restart, are all classes in mongrel to make the commands work. -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.
> From: mongrel-users-bounces at rubyforge.org > [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Zed Shaw > Sent: Wednesday, September 06, 2006 2:24 PM > To: mongrel-users at rubyforge.org > Subject: Re: [Mongrel] Error on Windows and FreeBSD > > > On Wed, 2006-09-06 at 14:42 +0100, Kris Leech wrote: > > First off Windows, because actually what I appear to be getting is a > > Rails error which only occurs when I use Mongrel, using > Webrick I do not > > get this error. > > I start Mongrel using: > > mongrel_rails start > > > > I have mongrel, win32-services and mongrel-service gems > installed even > > through Im not using mongrel as a service at the moment. > > > > The whole application works apart from one action. The > error I get is: > > > > > > NoMethodError in SearchController#results > > > > undefined method `table_name'' for Stop:Class > > Mongrel already has created a class called "Stop", so your > class is conflicting with it. > > Basically, Stop, Start, Restart, are all classes in mongrel > to make the commands work.Are these classes not wrapped in a ''Mongrel'' module? If not, it might be worth considering. If so, well, nevermind then. Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
Actually this naming problem is one of the hard-to-bite problems that hit everyone new and old to Ruby. We were recently hit by another couple of those name clashes: turns out you can not name your model attribute "binding" (this was appropriate for the model "Book"), nor can you use an attribute called "target" in your model. The unfortunate name collision problem is very hard to detect. The binding attribute/method was conflicting with Proc.binding and throwing error deep down ActiveRecord stack. If anyone knows a good approach to resolving name conflicts, or at least testing whether an issue being diagnosed may be a result of a name clash, please share. Thanks Konstantin On Sep 6, 2006, at 1:24 PM, Zed Shaw wrote:> On Wed, 2006-09-06 at 14:42 +0100, Kris Leech wrote: >> First off Windows, because actually what I appear to be getting is a >> Rails error which only occurs when I use Mongrel, using Webrick I >> do not >> get this error. >> I start Mongrel using: >> mongrel_rails start >> >> I have mongrel, win32-services and mongrel-service gems installed >> even >> through Im not using mongrel as a service at the moment. >> >> The whole application works apart from one action. The error I get >> is: >> >> >> NoMethodError in SearchController#results >> >> undefined method `table_name'' for Stop:Class > > Mongrel already has created a class called "Stop", so your class is > conflicting with it. > > Basically, Stop, Start, Restart, are all classes in mongrel to make > the > commands work. > > > -- > Zed A. Shaw > http://www.zedshaw.com/ > http://mongrel.rubyforge.org/ > http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060906/ab6d62ae/attachment.html
Luis Lavena wrote:>Wow, that''s nasty. > >What version of mongrel gem are you using? > >The latest version only installed this week.>Also, you said on Windows, but which one? > >XP>What ruby distro are you using? (hope mswin32 of 1.8.4 which is based >on VC6, same for One-Click Installer). > >Latest version of 1.8.4, which is compiled with VC6++.>It is only thrown apart when calling that method? which code contains? >(please paste for better understanding of what are you doing that >brake so badly). > >I dont have the code to hand today, but its a very simple class, almost a bare ActiveRecord class.> >On 9/6/06, Kris Leech <kris at alternativefocusmedia.com> wrote: > > >>First off Windows, because actually what I appear to be getting is a >>Rails error which only occurs when I use Mongrel, using Webrick I do not >>get this error. >>I start Mongrel using: >>mongrel_rails start >> >>I have mongrel, win32-services and mongrel-service gems installed even >>through Im not using mongrel as a service at the moment. >> >>The whole application works apart from one action. The error I get is: >> >> >> NoMethodError in SearchController#results >> >>undefined method `table_name'' for Stop:Class >> >>|(__DELEGATION__):2:in `__send__'' >>(__DELEGATION__):2:in `table_name'' >>#{RAILS_ROOT}/app/models/search.rb:58:in `find_runs'' >>#{RAILS_ROOT}/app/models/search.rb:44:in `depature_runs'' >>#{RAILS_ROOT}/app/controllers/search_controller.rb:100:in `results''| >> >> >> So my results action gives an error for table_name! The Stop model is >> used by various other controllers just fine. In Console I can do >> Stop.find_all, so I dont see how this error is being generated, >> besides the application server, mongrel, webrick or other, should not >> have any effect once it palms the request off to dispatcher? >> >> >>Many thanks AFM. >> >>PS. The freeBSD error can wait for another time :) >> >>_______________________________________________ >>Mongrel-users mailing list >>Mongrel-users at rubyforge.org >>http://rubyforge.org/mailman/listinfo/mongrel-users >> >> >> > > > >
Zed Shaw wrote:>On Wed, 2006-09-06 at 14:42 +0100, Kris Leech wrote: > > >>First off Windows, because actually what I appear to be getting is a >>Rails error which only occurs when I use Mongrel, using Webrick I do not >>get this error. >>I start Mongrel using: >>mongrel_rails start >> >>I have mongrel, win32-services and mongrel-service gems installed even >>through Im not using mongrel as a service at the moment. >> >>The whole application works apart from one action. The error I get is: >> >> >> NoMethodError in SearchController#results >> >>undefined method `table_name'' for Stop:Class >> >> > >Mongrel already has created a class called "Stop", so your class is >conflicting with it. > >Basically, Stop, Start, Restart, are all classes in mongrel to make the >commands work. > >I see. Hence why it works with webrick and not mongrel. I think we need a page in the wiki about possible name clashes, is it all classes in mongrel that will clash or just specific ones? I feel a bit out of order saying this, but would Stop, Start etc. not be better as methods to a single class?> > >
I can add some of my own....name collisions here: you shouldn''t have a table called messages and you shouldn''t have a column called quote. On 9/7/06, Kris Leech <krisleech at interkonect.com> wrote:> > Zed Shaw wrote: > > >On Wed, 2006-09-06 at 14:42 +0100, Kris Leech wrote: > > > > > >>First off Windows, because actually what I appear to be getting is a > >>Rails error which only occurs when I use Mongrel, using Webrick I do not > >>get this error. > >>I start Mongrel using: > >>mongrel_rails start > >> > >>I have mongrel, win32-services and mongrel-service gems installed even > >>through Im not using mongrel as a service at the moment. > >> > >>The whole application works apart from one action. The error I get is: > >> > >> > >> NoMethodError in SearchController#results > >> > >>undefined method `table_name'' for Stop:Class > >> > >> > > > >Mongrel already has created a class called "Stop", so your class is > >conflicting with it. > > > >Basically, Stop, Start, Restart, are all classes in mongrel to make the > >commands work. > > > > > I see. Hence why it works with webrick and not mongrel. I think we need > a page in the wiki about possible name clashes, is it all classes in > mongrel that will clash or just specific ones? > I feel a bit out of order saying this, but would Stop, Start etc. not be > better as methods to a single class? > > > > > > > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >-- nothing much to talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060908/76b53936/attachment.html