From: Kyle Cordes Date: 2001-12-03T11:20:43+09:00 Subject: [ruby-talk:27308] Using Ruby as a CGI under Windows/IIS I'm trying to run a Ruby CGI script under Windows 2000 / IIS. I am using the latest (Dec. 1) download of Win32 Ruby from the Pragmatic Programmer's web site. (I would use something persistant (like mod_ruby) etc. on Linux/unix for production use, but simple CGI under Windows would be good for development.) I have set up the appropriate mapping in IIS like so: ..rb -> c:\ruby\bin\ruby.exe %s %s I have Perl, Python, and PHP all working under this web server as CGI's (it's my development machine), and am familiar with adminstration of IIS, so I think I have it configured correctly. When I try to invoke a ruby script with a URL like so: http://localhost/ruby/t1.rb I get an error like this: ----- CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: c/ruby/bin/ruby: No such file or directory -- C:\web\sites\ruby\t1.rb (LoadError) --- (The details of the directories aren't important. The file certainly does exist in that directory.) If I hard-code the mapping like so: ..rb -> c:\ruby\bin\ruby.exe C:\web\sites\ruby\t1.rb I still get the same error. But if I move the file to the root directory, then change the mapping to this: ..rb -> c:\ruby\bin\ruby.exe /t1.rb The CGI script runs. If I type this as the command line: c:\ruby\bin\ruby.exe C:\web\sites\ruby\t1.rb the script runs (in the command window, not under CGI of course). It appears that, for some reason, when IIS passes the name of the script to ruby.exe, ruby.exe is unable to understand or find the file, even though it can display the file name. (rubyw.exe generates the same error) Any ideas? Does Ruby have some objection to Windows-style pathnames? Related question: Which Windows Ruby distribution should I be using? The one at pragmaticprogrammer.com? Is there another? -- [ Kyle Cordes * kyle@kylecordes.com * http://kylecordes.com ] [ Consulting, Training, and Software development tips and ] [ techniques: Java, Delphi, ASTA, BDE Alternatives Guide, ] [ JB Open Tools, EJB, Web applications, methodologies, etc. ]