[Ironruby-core] Preview of ironruby-rack gem

Ryan Riley ryan.riley at panesofglass.org
Tue Jul 6 23:14:08 EDT 2010

This is great, Jimmy! Thanks! I tried the simple example you explain below,
and everything worked except for deploying to IIS. Probably something I did
or didn't do, but it looks like IIS is looking in the wrong spot for my
web.config file. I'll try to dig further when I have a bit more time.






From: ironruby-core-bounces at rubyforge.org
[mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi
Sent: Friday, July 02, 2010 3:06 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Preview of ironruby-rack gem



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




First you'll need IronRuby 1.0 for .NET
<http://ironruby.codeplex.com/releases/view/25901>  4.0 installed:



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.NET
application 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/20100706/63e80ee6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 12353 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100706/63e80ee6/attachment-0001.png>

More information about the Ironruby-core mailing list