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.

 



 

Cheers,

Ryan

 

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

 

All,

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.

 

INSTALL

 

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

http://ironruby.codeplex.com/releases/view/25901#DownloadId=116524

 

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:
http://jimmy.schementi.com/downloads/ironruby-rack-0.0.9-universal-dotnet.ge
m

 

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.

USAGE

 

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

  'hi'

end

 

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
installation:

*       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.

 

FEEDBACK

 

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:

http://github.com/jschementi/ironruby/tree/master/Hosts/IronRuby.Rack

 

 

Enjoy,

~Jimmy

<<image001.png>>

_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to