Having trouble setting up RoR, FastCGI and Longhorn Beta 3 [Answered]RSS

3 replies

Last post Sep 01, 2007 01:36 PM by zopal

  • Having trouble setting up RoR, FastCGI and Longhorn Beta 3

    Aug 17, 2007 06:20 AM|DerekK19|LINK

    Longhorn Beta 3 seems to include fastcgi (iisfcgi.dll I think) and I've followed the 10 step program to installing RoR. However when it comes to setting up the web-site there things under IIS7 are completely different to IIS6.

    Has anyone had any success getting RoR running under IIS7. The best I've had has been under Vista - a General Silliness error, even with TP2.

    Thanks for any help

  • Re: Having trouble setting up RoR, FastCGI and Longhorn Beta 3

    Aug 17, 2007 11:47 PM|mvolo|LINK

    Hi Derek,

    The steps on my blog are for IIS6 only unfortunately, there are a couple of issues that prevent RoR from working on Vista / LHS FastCGI.  It is missing the extra support we added to the IIS6 version to allow RoR's "serve the static file if there, otherwise serve the Ruby script" functionality. 

    However, you should be able to set up the Vista/LHS version of FastCGI to request your RoR controller script directly.  Can you post the error you are receiving so we can take a look at it?  If you need help getting to the detailed error, please see Troubleshoot IIS7 errors like a pro.

    Also, be sure to set up permissions that IIS needs to access Ruby, and Ruby needs to access your application files: give Network Service read/execute access to the directory with Ruby executable, and your Ruby application files.


    Mike Volodarsky

    Program Manager
    IIS Core Server
    Visit mvolo.com for more inside information on IIS7, IIS and ASP.NET

    Ruby RoR Vista LHS

    Mike Volodarsky
    CTO at LeanSentry
    Former IIS/ASP.NET PM

  • Re: Having trouble setting up RoR, FastCGI and Longhorn Beta 3

    Aug 18, 2007 03:02 AM|DerekK19|LINK

    I've set up error logging as you described then the FREB mechanism as per Bill's blog and got a detailed report. I'll email that to you since it's 82Kb.

    The error indicated an I/O operation failed because of a thread exit or an application request. Not sure what that means. I've added execute access to the handler mapping (RB-iisfcgi). This didn't make a difference. I've added read,list,exec access to 'C:\Program Files\Ruby\*' for Everyone (maybe that's not good practice) and to my inetpub\www\rails folder. Again no difference.

    So then I Edited the RB-iisfcgi Handler Mapping and it wouldn't allow me to save the ruby.exe path until I enclosed it in quotes. I did that and now I get a bad-gateway error (502.2) not general silliness so that's some progress. It's probable that putting Ruby under C:\Program Files was a silly thing to do. Those darn spaces...

    The bad gateway error says the CGI application did not return a complete set of headers so I remembered the comment in your 10 step plan and removed a line from cgi.rb:

    #    if options.delete("nph") or
    #        (/IIS\/(\d+)/n.match(env_table['SERVER_SOFTWARE']) and $1.to_i < 5)
        if options.delete("nph")

    Still no difference, I still get the bad gateway error.

    I'll email you the two error XML dumps, maybe you'll be able to figure our what I'm doing wrong.




  • Re: Having trouble setting up RoR, FastCGI and Longhorn Beta 3

    Sep 01, 2007 01:36 PM|zopal|LINK

    I'm trying to setup Ruby on Rais on IIS7 FastCGI (LH beta 3) as well, without success.

    I have no idea how to pass arguments to the ruby.exe, that's maybe the part of the problem. If I just add the argument to the handler mapping I get the following error:

    <add name="Ruby" path="*" verb="*" modules="FastCgiModule" scriptProcessor="E:\ruby\bin\ruby.exe E:\ruby\myapp\public\dispatch.fcgi" resourceType="Either" />

    An unknown FastCGI error occured
    Error Code 0x8007010b

    If I just run the ruby.exe:

    <add name="Ruby" path="*" verb="*" modules="FastCgiModule" scriptProcessor="E:\ruby\bin\ruby.exe" resourceType="Either" />

    E:\ruby\bin\ruby.exe - The FastCGI process exited unexpectedly
    Error Code 0x00000001


    FastCGI IIS7 Ruby RoR LHS