The popularity of the Ruby on Rails framework is constantly growing, the society is becoming wider and, if it was rarely said about using Ruby on Windows, today it is a very real practice.
Projects like RubyInstaller (
http://rubyinstaller.org/ ) and RailsInstaller (
http://railsinstaller.org/ ) greatly simplify the creation of a working environment on Windows. You can use native MRI 1.8 and 1.9, JRuby or even IronRuby running on .NET. Most of the gem packages work with Windows, and thanks to DevKit (
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit ), sishnye jams can be collected directly from the sources.
However, despite the active development of development tools, until now Windows and, in particular, the IIS web server have practically not been used as a "production" solution for deploying Rails applications. But with the advent of the new Helicon Zoo tool based on the Web Platform Installer - this situation has changed.
')
Helicon zoo
Helicon Zoo is a repository of web frameworks and applications that allows you to easily install and run Rails, Django (virtually any rack, wsgi, or FastCGI applications) and Mojolicious on the IIS web server.
Helcon Zoo uses the Microsoft Web Platform Installer (
http://www.microsoft.com/web/downloads/platform.aspx ). This is a repository and deployment environment for web applications and frameworks from Microsoft, which already contains many ASP.NET and PHP applications. To implement the functionality, it was necessary only to create your own feed with products, so that users can conveniently and easily install from the repository.
However, simply adding products to the repository is not enough. The core of Helicon Zoo is the native IIS module, in fact, playing the role of a bridge between the IIS web server and frameworks on Ruby, Python and Perl, etc. The module works using the FastCGI protocol, which has already established itself as a reliable and fast method of interaction with the web server. I / O is processed asynchronously using IOCP technology. Named pipes or sockets are used as transport. In the near future, developers plan to fully implement support for asynchronous FastCGI (unfortunately, none of the currently existing frameworks asynchronous FastCGI support).
IIS 7, IIS 7.5, and IIS Express are supported.
Install Ruby on Rails
Download the Web Platform Installer (
http://www.microsoft.com/web/downloads/platform.aspx ) and run it. In the window that appears, click "Options":

In the options you need to add a link to the Helicon Zoo feed:
www.helicontech.com/zoo/feed
Now, if you select “Application” at the top and go to “Tools” in the menu on the left, you will see new applications: “Blank Ruby on Rails Project”, “Blank Django Project”, “Blank Perl Project” and “Blank Mojolicious Project”:

These are empty “Hello World” blanks that establish the necessary dependencies for further development.
Click on the “Add” button next to the “Blank Ruby on Rails Project” and then on the “Install” button.
The installer will offer to install the following dependencies:

After clicking on the “I Accept” button, the necessary packages will be downloaded and installed, after which you will be asked to configure the site for the new application.
You can create a new site or choose an existing one:

When installation and configuration are complete, the application is ready to run:

Under the hood
After installing the “Blank Ruby on Rails Project”
web . The config file for the selected IIS site looks like this:
<? xml version = "1.0" encoding = "UTF-8"?>
<configuration><system.webServer><handlers><add name = "rails.project.x86" scriptProcessor = "ruby.1.9.pipe" path = "*" verb = "*" modules = "HeliconZoo_x86" preCondition = "bitness32" resourceType = "Unspecified" requireAccess = "Script"
/><add name = "rails.project.x64" scriptProcessor = "ruby.1.9.pipe" path = "*" verb = "*" modules = "HeliconZoo_x64" preCondition = "bitness64" resourceType = "Unspecified" requireAccess = "Script"
/></ handlers></system.webServer></ configuration>By default, named pipes are used as the transport between the IIS module and the Ruby on Rails worker. To use sockets, it is enough to replace the “scriptProcessor” parameter with “ruby.1.9.tcp”.
All available script processors are described in the <heliconZooServer> section of the
applicationHost.config file.
Through the
web . The config can also affect how Rails applications work. So, for example, by default it runs in debug mode (RAILS_ENV = development). To switch to production mode, you can set the variable RACK_ENV as follows:
<? xml version = "1.0" encoding = "UTF-8"?><configuration><system.webServer><heliconZoo><application name = "rails.project.x64"
><environmentVariables><add name = "RACK_ENV" value = "production"
/></ environmentVariables></ application></ heliconZoo>The <heliconZoo> section in the web.config file is mainly used to set environment variables when invoking a worker. In fact, you can pass any necessary parameters to the application through the <environmentVariables> section. In Ruby, they will be available through the global ENV hash.
What's next?
Work on the project Helicon Zoo is very active, the developer
HeliconTech will be glad to any comments and suggestions. At the moment, to prepare an updated version, which will support MRI 1.8, JRuby, as well as Rails 2.3.
The Blank collection of blanks will soon be expanded by other Ruby frameworks, in particular Sinatra and ready-made applications, such as RedMine and others.