Doesn''t appear to work with WEBrick. Works find with Apache/FastCGI. Something wrong in the way Rails is trying to process paths from the WEBrick server. If I try to send in http://localhost:3000/recipes/new, WEBrick is interpreting /new as my controller, instead of my action.
I''ve the same problem , but only under Linux. On windows, WEBrick works correctly. Massimo> -----Original Message----- > From: Sean Bowman [mailto:sbowman-CKrQoQNUrt4AvxtiuMwx3w@public.gmane.org] > Sent: martedì 8 marzo 2005 1.04 > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: [Rails] Rails 0.10.1and WEBrick > > Doesn''t appear to work with WEBrick. Works find with Apache/FastCGI. > > Something wrong in the way Rails is trying to process paths from the > WEBrick server. If I try to send in http://localhost:3000/recipes/new, > WEBrick is interpreting /new as my controller, instead of my action. > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
I''ve experienced same problem and I reported this bug. See http://dev.rubyonrails.com/ticket/803 I had shoot this problem by commenting out all content in ~/.irbrc. I hope you to try it as I did, and add your comment to that ticket. On Tue, 8 Mar 2005 12:22:16 +0100, Nervi Massimo <Massimo.Nervi-5Ajj8d4WuGw@public.gmane.org> wrote:> I''ve the same problem , but only under Linux. On windows, WEBrick works > correctly. > > Massimo > > > -----Original Message----- > > From: Sean Bowman [mailto:sbowman-CKrQoQNUrt4AvxtiuMwx3w@public.gmane.org] > > Sent: martedì 8 marzo 2005 1.04 > > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > Subject: [Rails] Rails 0.10.1and WEBrick > > > > Doesn''t appear to work with WEBrick. Works find with Apache/FastCGI. > > > > Something wrong in the way Rails is trying to process paths from the > > WEBrick server. If I try to send in http://localhost:3000/recipes/new, > > WEBrick is interpreting /new as my controller, instead of my action. > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- http://nohmad.sub-port.net
Thanks, but I think it''s a different problem. Before upgrading to 0.10.1, my Linux application worked correctly. Now I''ve the same problem reported by other users ("list" action works, but not "edit" , "new" and "destroy") Massimo> -----Original Message----- > From: Gyoung-Yoon Noh [mailto:nohmad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org] > Sent: martedì 8 marzo 2005 16.06 > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: Re: [Rails] Rails 0.10.1and WEBrick > > I''ve experienced same problem and I reported this bug. > See http://dev.rubyonrails.com/ticket/803 > I had shoot this problem by commenting out all content in ~/.irbrc. > I hope you to try it as I did, and add your comment to that ticket. > > > On Tue, 8 Mar 2005 12:22:16 +0100, Nervi Massimo <Massimo.Nervi-5Ajj8d4WuGw@public.gmane.org> > wrote: > > I''ve the same problem , but only under Linux. On windows, WEBrick works > > correctly. > > > > Massimo > > > > > -----Original Message----- > > > From: Sean Bowman [mailto:sbowman-CKrQoQNUrt4AvxtiuMwx3w@public.gmane.org] > > > Sent: martedì 8 marzo 2005 1.04 > > > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > Subject: [Rails] Rails 0.10.1and WEBrick > > > > > > Doesn''t appear to work with WEBrick. Works find with Apache/FastCGI. > > > > > > Something wrong in the way Rails is trying to process paths from the > > > WEBrick server. If I try to send in > http://localhost:3000/recipes/new, > > > WEBrick is interpreting /new as my controller, instead of my action. > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > http://nohmad.sub-port.net > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
From: http://one.textdrive.com/pipermail/rails/2005-March/004131.html "Doesn''t appear to work with WEBrick. Works find with Apache/FastCGI. Something wrong in the way Rails is trying to process paths from the WEBrick server. If I try to send in http://localhost:3000/recipes/new, WEBrick is interpreting /new as my controller, instead of my action." Has anyone come up with a fix for this? -- Bill Guindon (aka aGorilla)
On Sat, 12 Mar 2005 15:16:28 -0500, Bill Guindon <agorilla-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> From: > http://one.textdrive.com/pipermail/rails/2005-March/004131.html > > "Doesn''t appear to work with WEBrick. Works find with Apache/FastCGI. > > Something wrong in the way Rails is trying to process paths from the > WEBrick server. If I try to send in http://localhost:3000/recipes/new, > WEBrick is interpreting /new as my controller, instead of my action." > > Has anyone come up with a fix for this? >More details would be nice.
On Saturday 12 March 2005 15:21, Joe Van Dyk wrote:> > "Doesn''t appear to work with WEBrick. Works find with Apache/FastCGI. > > > > Something wrong in the way Rails is trying to process paths from the > > WEBrick server. If I try to send in http://localhost:3000/recipes/new, > > WEBrick is interpreting /new as my controller, instead of my action."To be honest, I ran into a problem that might be related. If you don''t mind diving into the rails source, here are some steps you can do that might fix it for you: 1. Open Action Pack''s request.rb file: sudo emacs -nw actionpack/lib/action_controller/request.rb Find the method "path_info" Change it''s definition to: def path_info nil end Check syntax, save, close. Restart any Rails apps you have running. Write back and let me know if that fixed it. -- Nicholas Seckar aka. Ulysses
On Sat, 2005-03-12 at 15:30 -0500, Nicholas Seckar wrote:> Check syntax, save, close. Restart any Rails apps you have running. Write back > and let me know if that fixed it. >This fixes it, there''s a ticket in trac to remove path_info with ticket #822. -- Jim Ray <jim-rhf1kIDhBaeB8E1WFlbJj6xOck334EZe@public.gmane.org>
On Sat, 12 Mar 2005 12:21:51 -0800, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sat, 12 Mar 2005 15:16:28 -0500, Bill Guindon <agorilla-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > From: > > http://one.textdrive.com/pipermail/rails/2005-March/004131.html > > > > "Doesn''t appear to work with WEBrick. Works find with Apache/FastCGI. > > > > Something wrong in the way Rails is trying to process paths from the > > WEBrick server. If I try to send in http://localhost:3000/recipes/new, > > WEBrick is interpreting /new as my controller, instead of my action." > > > > Has anyone come up with a fix for this? > > > > More details would be nice.Well, it''s all been said before by Sean Bowman, here''s the buildup: This is the problem I''m having, only difference is, it''s on WinXP http://one.textdrive.com/pipermail/rails/2005-March/004117.html I''ve tried variations on install/uninstall as Sean does here: http://one.textdrive.com/pipermail/rails/2005-March/004124.html Oddly, this tip did not work for me (changing /recipe/new to /recipe?action=new) http://one.textdrive.com/pipermail/rails/2005-March/004126.html He came to the conclusion that it''s a WEBRick only issue (as posted/linked above), don''t know if it''s true, but I''m pretty much repeating Sean''s problem here. PS to Sean: If you''d replied to your own first post, it would have neatly packaged all of those posts as a single thread making it easier to follow, and more likely to get a reply (imnsho), -- Bill Guindon (aka aGorilla)
On Sat, 12 Mar 2005 15:30:04 -0500, Nicholas Seckar <nseckar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Saturday 12 March 2005 15:21, Joe Van Dyk wrote: > > > "Doesn''t appear to work with WEBrick. Works find with Apache/FastCGI. > > > > > > Something wrong in the way Rails is trying to process paths from the > > > WEBrick server. If I try to send in http://localhost:3000/recipes/new, > > > WEBrick is interpreting /new as my controller, instead of my action." > > To be honest, I ran into a problem that might be related. If you don''t mind > diving into the rails source, here are some steps you can do that might fix > it for you: > > 1. Open Action Pack''s request.rb file: > sudo emacs -nw actionpack/lib/action_controller/request.rb > Find the method "path_info" > Change it''s definition to: > > def path_info > nil > end > > Check syntax, save, close. Restart any Rails apps you have running. Write back > and let me know if that fixed it.Indeed it did. Thanks much. Are there likely to be any side effects from doing this that I should be aware? -- Bill Guindon (aka aGorilla)
On Saturday 12 March 2005 17:00, Bill Guindon wrote:> Are there likely to be any side effects from doing this that I should be > aware?PATH_INFO is only required for lighttpd cgi servers. Since most lighttpd users use fcgi, this probably won''t affect you at all. The use of PATH_INFO is slated to cut in a little while. Cheers, -- Nicholas Seckar aka. Ulysses
Hi all, If I have a table "countries" and a join table "countries_countries" to define an adjacency relationship, how can I define the relationship in rails without duplicating all entries? The problem is that if "A" is adjacent to "B", "B" is also adjacent to "A". The join table should have only one line and not two... I tried has_and_belongs_to_many :adjacencies, :class_name => "Country", :association_foreign_key => "adjacentcountry_id", :uniq => "true" has_and_belongs_to_many :adjacencies, :class_name => "Country", :foreign_key => "adjacentcountry_id", :association_foreign_key => "country_id", :uniq => "true" to get both possibilities, but it did not work. Any help would be appreciated, Pedro
On 19.3.2005, at 20:05, Pedro Santos wrote:> Hi all, > > If I have a table "countries" and a join table "countries_countries" to > define an adjacency relationship, how can I define the relationship in > rails without duplicating all entries? > > The problem is that if "A" is adjacent to "B", "B" is also adjacent to > "A". > The join table should have only one line and not two... > > I tried > > has_and_belongs_to_many :adjacencies, :class_name => "Country", > :association_foreign_key => "adjacentcountry_id", :uniq => "true" > > has_and_belongs_to_many :adjacencies, :class_name => "Country", > :foreign_key => "adjacentcountry_id", :association_foreign_key => > "country_id", :uniq => "true" > > to get both possibilities, but it did not work.It can''t work since the two associations have the same name. As for duplication, just put the line in once (from whichever direction) and create a custom method that gives you both directions. Something like this: has_and_belongs_to_many :a_adjacencies, ... has_and_belongs_to_many :b_adjacencies, ... def adjacencies a_adjacencies.merge(b_adjacencies) end //jarkko> > Any help would be appreciated, > > Pedro > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Jarkko Laine http://jlaine.net http://odesign.fi _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi again, Using the Countries example, if I have an attribute in the join table "countries_countries", which is a foreign key to another table "frontiertypes", how do I update this attribute? I tried CountryA.adjacencies.find(CountryB.id).frontiertype_id = id but it did not work... Thanks, Pedro
on 05/03/19 6:29 PM, Jarkko Laine at jarkko-k1O+Gnc6WpmsTnJN9+BGXg@public.gmane.org wrote:> > On 19.3.2005, at 20:05, Pedro Santos wrote: > >> Hi all, >> >> If I have a table "countries" and a join table "countries_countries" to >> define an adjacency relationship, how can I define the relationship in >> rails without duplicating all entries? >> >> The problem is that if "A" is adjacent to "B", "B" is also adjacent to >> "A". >> The join table should have only one line and not two... >> >> I tried >> >> has_and_belongs_to_many :adjacencies, :class_name => "Country", >> :association_foreign_key => "adjacentcountry_id", :uniq => "true" >> >> has_and_belongs_to_many :adjacencies, :class_name => "Country", >> :foreign_key => "adjacentcountry_id", :association_foreign_key => >> "country_id", :uniq => "true" >> >> to get both possibilities, but it did not work. > > It can''t work since the two associations have the same name. > > As for duplication, just put the line in once (from whichever > direction) and create a custom method that gives you both directions. > Something like this: > > has_and_belongs_to_many :a_adjacencies, ... > has_and_belongs_to_many :b_adjacencies, ... > > def adjacencies > a_adjacencies.merge(b_adjacencies) > endI thought about that solution. But will not the "rails magic" be destroyed? For instance, will the methods find, push, delete, etc still work as expected for a has_and_belongs_to_many relation? Thanks, Pedro
Hi again, Using your suggestion below I get the following error: NoMethodError in Import#tests: undefined method `merge'' for #<Array:0x276d1d4> If instead of merge I use the method concat, because rails overwrote that method, I get ActiveRecord::StatementInvalid in Import#tests: Duplicate entry ''30-13'' for key 1: INSERT INTO... What am I doing wrong? Thanks, Pedro on 05/03/19 6:29 PM, Jarkko Laine at jarkko-k1O+Gnc6WpmsTnJN9+BGXg@public.gmane.org wrote:> > On 19.3.2005, at 20:05, Pedro Santos wrote: > >> Hi all, >> >> If I have a table "countries" and a join table "countries_countries" to >> define an adjacency relationship, how can I define the relationship in >> rails without duplicating all entries? >> >> The problem is that if "A" is adjacent to "B", "B" is also adjacent to >> "A". >> The join table should have only one line and not two... >> >> I tried >> >> has_and_belongs_to_many :adjacencies, :class_name => "Country", >> :association_foreign_key => "adjacentcountry_id", :uniq => "true" >> >> has_and_belongs_to_many :adjacencies, :class_name => "Country", >> :foreign_key => "adjacentcountry_id", :association_foreign_key => >> "country_id", :uniq => "true" >> >> to get both possibilities, but it did not work. > > It can''t work since the two associations have the same name. > > As for duplication, just put the line in once (from whichever > direction) and create a custom method that gives you both directions. > Something like this: > > has_and_belongs_to_many :a_adjacencies, ... > has_and_belongs_to_many :b_adjacencies, ... > > def adjacencies > a_adjacencies.merge(b_adjacencies) > end > > > //jarkko > >> >> Any help would be appreciated, >> >> Pedro >>