Ball, Donald A Jr \(Library\)
2007-Jan-12 18:50 UTC
trouble invoking dispatch.rb via cgi on IIS5
Howdy folks. I''m trying to get a rails app running behind IIS5. Yes, I know, I know, but my hands are tied. After much banging my head against FastCGI and friends, I''ve decided to try to get it working using vanilla CGI first and then maybe attempt something more ambitious. I mapped .rb to ''c:\ruby\bin\rubyw.exe "%s" %s'' in IIS''s Application Configuration, Application Mappings dialog, making sure to uncheck the "Check that file exists" box. Thereafter, I tried to hit one of my applications'' URLs through dispatch.rb: http://localhost/dispatch.rb/patrons/login and sadly, I get this stacktrace: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: Status: 400 Bad Request c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1.5618/lib/active_suppo rt/dependencies.rb:399:in `to_constant_name'': Anonymous modules have no name to be referenced by (ArgumentError) from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1.5618/lib/active_suppo rt/dependencies.rb:211:in `qualified_name_for'' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1.5618/lib/active_suppo rt/dependencies.rb:470:in `const_missing'' from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6.5618/lib/dispatcher.rb:116:in `reset_after_dispatch'' from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6.5618/lib/dispatcher.rb:51:in `dispatch'' from C:/sites/npl/public/dispatch.rb:10 I''m using rails-1.2rc1 with ruby-1.8.4, winxpsp2, iis5. Any suggestions? - donald --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''ve never tried this, but the things to check are: 1) What''s in your path under IIS and what version of Ruby does it point to? 2) Does your shebag #! line in dispatch.cgi point to someplace other than c:\ruby\bin\rubyw.exe? Let everyone know in case we need to deploy under IIS. Ball, Donald A Jr (Library) wrote:> > > Howdy folks. I''m trying to get a rails app running behind IIS5. Yes, I > know, I know, but my hands are tied. After much banging my head against > FastCGI and friends, I''ve decided to try to get it working using vanilla > CGI first and then maybe attempt something more ambitious. > > I mapped .rb to ''c:\ruby\bin\rubyw.exe "%s" %s'' in IIS''s Application > Configuration, Application Mappings dialog, making sure to uncheck the > "Check that file exists" box. Thereafter, I tried to hit one of my > applications'' URLs through dispatch.rb: > > http://localhost/dispatch.rb/patrons/login > > and sadly, I get this stacktrace: > > CGI Error > The specified CGI application misbehaved by not returning a complete set > of HTTP headers. The headers it did return are: > > Status: 400 Bad Request > > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1.5618/lib/active_suppo > rt/dependencies.rb:399:in `to_constant_name'': Anonymous modules have no > name to be referenced by (ArgumentError) > from > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1.5618/lib/active_suppo > rt/dependencies.rb:211:in `qualified_name_for'' > from > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1.5618/lib/active_suppo > rt/dependencies.rb:470:in `const_missing'' > from > c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6.5618/lib/dispatcher.rb:116:in > `reset_after_dispatch'' > from > c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6.5618/lib/dispatcher.rb:51:in > `dispatch'' > from C:/sites/npl/public/dispatch.rb:10 > > I''m using rails-1.2rc1 with ruby-1.8.4, winxpsp2, iis5. Any suggestions? > > - donald > > > > >-- View this message in context: http://www.nabble.com/-Rails--trouble-invoking-dispatch.rb-via-cgi-on-IIS5-tf2967702.html#a8304304 Sent from the RubyOnRails Users mailing list archive at Nabble.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 -~----------~----~----~----~------~----~------~--~---
Ball, Donald A Jr \(Library\)
2007-Jan-12 20:44 UTC
Re: trouble invoking dispatch.rb via cgi on IIS5
> I''ve never tried this, but the things to check are: > > 1) What''s in your path under IIS and what version of Ruby > does it point to?Not entirely sure what you mean, but I''ll try to answer. The home directory for the web site in question points to my rails app''s public directory. The ISAPI extension mapping associates .rb with c:\ruby\bin\rubyw.exe, which happens to be ruby-1.8.4.> 2) Does your shebag #! line in dispatch.cgi point to > someplace other than c:\ruby\bin\rubyw.exe?I''m using dispatch.rb, not dispatch.cgi, not that it really matters as their contents are identical. The shebang points to c:\ruby\bin\ruby, not that it matters as the shebang isn''t interpreted in windows. In any case, changing it to rubyw had no effect.> Let everyone know in case we need to deploy under IIS.Easier said than done, it would seem. None of the IIS+FastCGI recipes I''ve tried work, and debugging data are scarce to non-existent even when you get close. I''m also evaluating using mongrel with IIS proxying in front of it, which does work quite nicely, but relying on a single mongrel process seems to present scalability issues as the number of concurrent requests rise, and not only does mongrel_cluster not work in win32, it requires another component to do load balancing of requests across the cluster. That component seems to typically be pen, another piece of software unavailable on win32. Guessing that perhaps if I can get CGI working properly, FastCGI might follow, I''m trying what should be the simplest (and slowest) method, and as you can see, have been stymied. - donald --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---