Duane Morin
2010-Jan-08 19:20 UTC
Phusion Passenger on a sub-URI - deleting my controller name
I know this must be a configuration error on my part but I can''t figure it out. I have a Rails application running on a sub-URI, and within that I have sevearl different controller/entry points. So in my httpd.conf file I''ve got the appropriate statements: RailsBaseURI /foo RailsBaseURI /bar RailsBaseURI /baz Then in my docroot I''ve got softlinks appropriately: ln -s /html/rails/myapp/public /html/docroot/www/foo ln -s /html/rails/myapp/public /html/docroot/www/bar ln -s /html/rails/myapp/public /html/docroot/www/baz And lastly in /html/rails/myapp/app/controllers I''ve got: foo_controller.rb bar_controller.rb baz_controller.rb I''ve done no special manipulations to the config/routes.rb file. This has all been working fine, in production, for months. if I point to foobar.com/foo I go to the right place. However for a new project I added a fourth controller, we''ll call it /quux. I did all of the above, creating a base uri, a soft link, and my controller. What''s weird is that when I try to deploy it I''m constantly getting an error "No route matches "". What appears to be happening is that something in the process is eating my controller name, because if I point to /quux/quux, then the quux controller is invoked just fine. So Passenger is recognizing that it should hand off the request to my Rails app, but my apps basically getting "" as a request and there is no default route. The other links work fine, and from everythign I can tell they are set up the exact same (but, obviously, they must not be). I could swear I''ve seen a similar "have to double the reference in the URI" problem in the past, but I can''t find it now that I need it. I''ve been searching, and found plenty of examples of setting up a sub-URI with Passenger, but nothign really dealing with this odd problem of the controller name not getting passed along. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Duane Morin
2010-Jan-08 19:30 UTC
Re: Phusion Passenger on a sub-URI - deleting my controller name
One thing I forgot -- if I just fire this up with script\server and hit localhost:3000/quux, it works fine. So I don''t expect it has anything to do with this particular controller, or the routes. The best I can tell is that Passenger is stripping out the /quux part, and I can''t figure out why. It''s following it, I mean, I end up invoking my rails app in some way, right? So it clearly saw my link and understood what to do with it. But then it ate it. Duane Morin wrote:> I know this must be a configuration error on my part but I can''t figure > it out. I have a Rails application running on a sub-URI, and within > that I have sevearl different controller/entry points. So in my > httpd.conf file I''ve got the appropriate statements: > RailsBaseURI /foo > RailsBaseURI /bar > RailsBaseURI /baz > > Then in my docroot I''ve got softlinks appropriately: > > ln -s /html/rails/myapp/public /html/docroot/www/foo > ln -s /html/rails/myapp/public /html/docroot/www/bar > ln -s /html/rails/myapp/public /html/docroot/www/baz > > And lastly in /html/rails/myapp/app/controllers I''ve got: > foo_controller.rb > bar_controller.rb > baz_controller.rb > > I''ve done no special manipulations to the config/routes.rb file. > > This has all been working fine, in production, for months. if I point > to foobar.com/foo I go to the right place. > > However for a new project I added a fourth controller, we''ll call it > /quux. > I did all of the above, creating a base uri, a soft link, and my > controller. > > What''s weird is that when I try to deploy it I''m constantly getting an > error "No route matches "". What appears to be happening is that > something in the process is eating my controller name, because if I > point to /quux/quux, then the quux controller is invoked just fine. So > Passenger is recognizing that it should hand off the request to my Rails > app, but my apps basically getting "" as a request and there is no > default route. > > The other links work fine, and from everythign I can tell they are set > up the exact same (but, obviously, they must not be). I could swear > I''ve seen a similar "have to double the reference in the URI" problem in > the past, but I can''t find it now that I need it. I''ve been searching, > and found plenty of examples of setting up a sub-URI with Passenger, but > nothign really dealing with this odd problem of the controller name not > getting passed along.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.