[Ironruby-core] Preview of ironruby-rack gem

Jimmy Schementi jimmy at schementi.com
Fri Jul 2 18:06:25 EDT 2010


I’d like your feedback and testing of a *early-but-near-to-beta-quality* build
of IronRuby.Rack, packaged in a RubyGem with some very simple scripts to
configure rack-based applications for running on
ASP.NET<http://www.asp.net/>and deploying to
IIS <http://www.iis.net/> on Windows.


First you'll need IronRuby 1.0 for .NET

Since it’s a for-the-mailing-list-only preview, I am not publishing it to
rubygems.org until I’ve gotten enough of your feedback that it’s ready, so
you’ll have to first download the gem from:

And then install it with your IronRuby installation:
D:\>igem install path\to\ironruby-rack-0.0.9-universal-dotnet.gem

This gem packages up the following components:

   - IronRuby.Rack.dll: integration between Rack and ASP.NET
   - Cassini.exe: a open-source development-time web server
   - rack2aspnet <app_path> [rails|sinatra]: takes a Rack application and
   enables it to run on ASP.NET
   - deploy2iis <app_name> <app_path>: takes a Rack-enabled
ASP.NETapplication and deploys it to the IIS web server.


Lets take a tiny Sinatra app and deploy it to IIS. Given this app:

D:\>cd demo

D:\>more app.rb
require 'rubygems'
require 'sinatra'

get '/' do

Run rack2aspnet to set it up for running on ASP.NET:

D:\demo>rack2aspnet . sinatra

rack2aspnet copied IronRuby.Rack, Cassini, and your local copy of IronRuby
to the "bin" directory, a config.ru for sinatra (if not present already),
and a web.config all pre-configured to point at your local IronRuby

   - bin\Cassini.exe
   - bin\ir.exe
   - bin\ir.exe.config
   - bin\IronRuby.dll
   - bin\IronRuby.Libraries.dll
   - bin\IronRuby.Libraries.Yaml.dll
   - bin\IronRuby.Rack.dll
   - bin\Microsoft.Dynamic.dll
   - bin\Microsoft.Scripting.dll
   - config.ru
   - log
   - web.config

Because it's been ASP.NET-ified, it can run on any ASP.NET web-server; this
gem includes Cassini.exe:

D:\demo>bin\Cassini.exe D:\demo 9202 /

Now this app can be deployed to an IIS web server with deploy2iis:

D:\demo>deploy2iis myapp d:\demo
Gives IIS_IUSRS FullControl to d:\demo
myapp has been created successfully.
myapp has been configured successfully.
IIS Restarted

Note: you'll still have to give IIS_IUSRS read-only access to your IronRuby
installation; the script will enable this in the future.

You can now navigate to the Sinatra app at http://localhost/myapp, which
will be running on IIS.


For now, just reply to the list with any major issues you find. Feel free to
try it with your own apps too, but make sure they run OK on IronRuby first.

If you find some bugs and what to take a stab at fixing them yourself, you
can find the source code here:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100702/399f9db5/attachment.html>

More information about the Ironruby-core mailing list