# Trouble invoking dispatch.rb via cgi on IIS5

**URL:** <https://www.ruby-forum.com/t/trouble-invoking-dispatch-rb-via-cgi-on-iis5/82377>\
**Category:** Rails\
**Created:** [January 19, 2007, 4:29pm UTC](https://www.ruby-forum.com/t/trouble-invoking-dispatch-rb-via-cgi-on-iis5/82377 "2007-01-19T16:29:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/da6949/32.png) [@BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/u/BallS_Donald_A_Jr_S)\
**Post date:** [January 19, 2007, 4:29pm UTC](https://www.ruby-forum.com/t/trouble-invoking-dispatch-rb-via-cgi-on-iis5/82377/1 "2007-01-19T16:29:56Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/da6949/32.png) [@BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/u/BallS_Donald_A_Jr_S)\
**Post date:** [September 25, 2007, 10:32pm UTC](https://www.ruby-forum.com/t/trouble-invoking-dispatch-rb-via-cgi-on-iis5/82377/2 "2007-09-25T22:32:34Z")

</div>

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:

> applications’ URLs through dispatch.rb:
> 
> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6.5618/lib/dispatcher.rb:116:in
> 
> >

–  
View this message in context:  
[http://www.nabble.com/-Rails--trouble-invoking-dispatch.rb-via-cgi-on-IIS5-tf2967702.html#a8304304](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](http://Nabble.com).
