We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Ruby/SinatraRSS

3 replies

Last post Mar 20, 2016 06:14 PM by Dadamax

  • Ruby/Sinatra

    Mar 20, 2016 12:27 AM|Dadamax|LINK

    I am trying to setup a web site using Ruby/Sinatra. Normally I would the command `ruby helloworld.rb' to start the web server from Ruby, so I'd imagine IIS should use the same command, right? In the examples, from http://www.iis.net/learn/extensions/httpplatformhandler/httpplatformhandler-configuration-reference, the only extra parameter seems to be the port HTTP_PLATFORM_PORT, which I added as well.
    However IIS ends in timeout without loading anything. What am I missing?

    This is my (simple) web.config: 

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <handlers>
    <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" requireAccess="Script" />
    </handlers>
    <httpPlatform stdoutLogEnabled="true"
    stdoutLogFile="sinatra.log"
    startupTimeLimit="20"
    processPath="c:\dev\ruby\bin\ruby.exe"
    arguments="D:\web\nosside\helloworld.rb -p %HTTP_PLATFORM_PORT%">
    </httpPlatform>
    </system.webServer>
    </configuration>

  • Re: Ruby/Sinatra

    Mar 20, 2016 08:34 AM|lextm|LINK

    Lex Li
    Want to have a chat on the issues you meet? Book an appointment at https://buy.stripe.com/cN24ia0yi7sAdIA7sv
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Ruby/Sinatra

    Mar 20, 2016 06:10 PM|Dadamax|LINK

    Hi Lex, 

    I've consulted that page, but I still don't understand what I am missing.  It seems he describes an additional part only related to rails, apparently because in his case the site isn't in the top folder. I can see from ProcessExplorer that ruby is invoked as:

    c:\dev\ruby\bin\ruby.exe D:\web\nosside\helloworld.rb -p 10666

    which, according to my understanding, is all that is expected, i.e. the way to invoke the ruby server + passing the port to listen. Moreover I am able to connect and see the web application if directly going with the browser to localhost:10666.


    Thanks,
    Dadamax

  • Re: Ruby/Sinatra

    Mar 20, 2016 06:14 PM|Dadamax|LINK

    Is there any additional permission to the root folder that needs to be set for IIS ?