Forum: IronRuby Preview of ironruby-rack gem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jimmy Schementi (Guest)
on 2010-07-03 00:10
(Received via mailing list)

I’d like your feedback and testing of a *early-but-near-to-beta-quality*
of IronRuby.Rack, packaged in a RubyGem with some very simple scripts to
configure rack-based applications for running on
ASP.NET<>and deploying to
IIS <> 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 until I’ve gotten enough of your feedback that it’s ready,
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
   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
to the "bin" directory, a for sinatra (if not present
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
   - log
   - web.config

Because it's been ASP.NET-ified, it can run on any ASP.NET web-server;
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
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

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

Kevin Radcliffe (Guest)
on 2010-07-06 22:17
(Received via mailing list)
 This is great! Thanks for your work.

 I've run into a few issues so far:

1) not IronRuby.Rack's fault, but the latest rack (1.2.1) breaks the
test app above due to this issue:
    (I had to apply the patch mentioned via that link to get things
w/ rack 1.2.1)

2) Is there any way you can detect if sintra is not already installed
running: rack2aspnet . sinatra
    I did not have the gem installed, and so I received an error when
browsing to the app via cassini
    If possible, it would be cool to warn the user that sinatra (or
is not installed when running rack2aspnet

 3) Very minor - I created the app.rb like above, and then ran
     At first, I was a little confused why my app.rb wasn't used at all,
instead, some default text from the was used instead.
     Is it possible to detect if app.rb already exists, and use it by
default if so (from the

  Will continue working with this, thanks again!

Best Regards,
Kevin Radcliffe
Ryan Riley (Guest)
on 2010-07-07 05:48
(Received via mailing list)
Ironruby-core mailing list
Ryan Riley (Guest)
on 2010-07-07 06:02
(Received via mailing list)
[] On Behalf Of Kevin
Sent: Tuesday, July 06, 2010 1:11 PM
Subject: Re: [Ironruby-core] Preview of ironruby-rack gem

 3) Very minor - I created the app.rb like above, and then ran

     At first, I was a little confused why my app.rb wasn't used at all,
instead, some default text from the was used instead.

     Is it possible to detect if app.rb already exists, and use it by
default if so (from the

I hit this, too. If nothing else, just don't put a default app in the at all and let the developer add it. I know you only add the if it doesn't already exist. I suppose it's a toss up as to
whether to show a default message or leave it blank. I can go either
but I kinda lean toward blank.

Kevin Radcliffe (Guest)
on 2010-07-07 19:15
(Received via mailing list)
Ironruby-core mailing list
Kevin Radcliffe (Guest)
on 2010-07-07 23:26
(Received via mailing list)

As mentioned before, it appears (at least on my own Windows 7 x64
that add_acl (in lib\rack\deploy\iis.rb) was not giving FullControl
to IIS_IUSRS as expected.
This results in the "cannot read configuration file" that Ryan reported

I was able to get the system to give appropriate rights to IIS_IUSRS but
a very strange way:

I had to give it 2 FileSystemAccessRules, one simpler one and the full
(that you already had in iis.rb)
If I give it one or the other but not BOTH, it will add IIS_IUSRS as a
of the app directory, but will NOT give it any permissions at all.

Here's the gist with my minor edits (in case it is helpful).
(again, this is from lib\rack\deploy\iis.rb):

Unfortunately, I'm not really sure WHY this is the case.
It seems strange to be required to essentially add 2 rules that appear
to do
the same thing.

Best Regards,
Kevin Radcliffe
F0f461459193aa098a80bd3e74e0ac9c?d=identicon&s=25 Shay Friedman (shayfriedman)
on 2010-07-20 18:44
(Received via mailing list)

I'm checking out the new IronRuby.Rack utils with a small web
(not the sample one) I have here.
The first problems I had were related to version problems since the
had been created using version (and I'm using 1.1). Small fixes
the references in the project made this problem go away.

Another problem was that the virtual directory on the IIS server was
using the default application pool, which uses .NET 2. Since I'm using
.NET 4 version I had to change the application pool.

Last problem, which I couldn't figure out yet is that now I get the next

unknown: No coercion operator is defined between types 'System.String'
and 'IronRuby.Builtins.MutableString'. (TypeError)

I took a look at the log and it seems like the problem is somewhere in

        private object Rackup() {
            Utils.Log("=> Loading Rack application");
            var fullPath = Path.Combine(_appRoot, "");
            if (File.Exists(fullPath)) {
                return IronRubyEngine.ExecuteMethod<RubyArray>(
            return null;

Any ideas?

Shay Friedman | Microsoft Visual C#/IronRuby MVP | Author of IronRuby
Blog: | Twitter:

On Wed, Jul 7, 2010 at 11:20 PM, Kevin Radcliffe
Ryan Riley (Guest)
on 2010-08-01 03:56
(Received via mailing list)

What's the status with some of the issues identified so far? Also, have
made it easier to switch between 1.0 and 1.1?


Ryan Riley
9a1370b744a6251dc02d716da9178f73?d=identicon&s=25 David Furber (dfurber)
on 2010-08-19 15:33
First, thank you for doing what you're doing. The sooner we can develop
Rails 3 apps in IronRuby and deploy them to IIS without pain, the
better! Especially since the pain level can be a deciding factor in
whether to use Rails or ASP.NET MVC 2.

That said, I've followed the instructions above. I have a Rails 2.3.5
app with Rack 1.0.1 that runs fine under webrick.

rack2aspnet did what you suggested it would do.
deploy2iis told me I needed Administrator privileges. Closed command
window, reopened with administrator privileges. Ran again, did what you
suggested it would do.

In browser, I get error screen:

Error: undefined method `parse_file' for Rack::Builder:Class

unknown: undefined method `parse_file' for Rack::Builder:Class

Search paths


Gem paths

C94afbb820c49a847b3b1f5244178f82?d=identicon&s=25 Eduardo Blumenfeld (eblumenfeld)
on 2010-11-02 14:11
Hi all,

First, thank you for all the effort put in this project.

Is there any news on this particular project (ironruby-rack gem), going
forward with the release 1.1.1?

55dfc0d42c02b7e7d660f2c05970c3fa?d=identicon&s=25 Tina Lee (belstaff)
on 2010-12-06 08:38
C94afbb820c49a847b3b1f5244178f82?d=identicon&s=25 Eduardo Blumenfeld (eblumenfeld)
on 2011-02-18 15:07
Hi all,

IronRuby 1.1.2 is really working good...

I was trying to see what is the status of this project,
it seems to be no longer in the original path in github.

Is there any news-updates on that?
Is there any way to contribute to the project?



Eduardo Blumenfeld wrote in post #958706:
> Hi all,
> First, thank you for all the effort put in this project.
> Is there any news on this particular project (ironruby-rack gem), going
> forward with the release 1.1.1?
> Eduardo
C94afbb820c49a847b3b1f5244178f82?d=identicon&s=25 Eduardo Blumenfeld (eblumenfeld)
on 2011-04-23 20:10
Eduardo Blumenfeld wrote in post #982472:
Hi all,

IronRuby 1.1.2 is working really good in production for wpf
Do you know the status of the IronRuby-Rack project?

Is there any way to contribute?

959b1c9d700abfc065f5f40bf5a966a2?d=identicon&s=25 James Schementi (jschementi)
on 2011-04-23 21:45
(Received via mailing list)
On Sat, Apr 23, 2011 at 2:10 PM, Eduardo Blumenfeld
<> wrote:
> IronRuby 1.1.2 is working really good in production for wpf
> applications.
> Do you know the status of the IronRuby-Rack project?

Not much going on. Should at least make sure it's rack-1.2.0 compatible.

> Is there any way to contribute?

If you want to submit patches, source is here:

If you want to contribute blog-posts, tutorials, or documentation,
send it to the mailing list and we'll figure out where best to put it.

Kevin Radcliffe (Guest)
on 2011-04-24 06:19
(Received via mailing list)
I may also be interested in contributing to move IronRuby.Rack toward
rack-1.2.0 compatibility.

I would imagine (but this could be totally wrong) that we would want to
more tests over from:

Would this be a good approach?
Where would be a good place for them, here?
(Or pehaps a subdirectory off of that)

If it isn't a good approach, what would be a better way to move toward

Best Regards,
Kevin Radcliffe
959b1c9d700abfc065f5f40bf5a966a2?d=identicon&s=25 James Schementi (jschementi)
on 2011-04-24 15:18
(Received via mailing list)
There are two important parts to testing IronRuby-Rack:

First, we need to make sure IronRuby can run rack 1.2. This will be a
subset of the tests as rack has tests for mongrel and thin, which we
won't be able to run, but the webrick test is fair game. The rack tests
are checked into external/languages/ruby/tests, as we used to run rack
tests against IronRuby in CI. So just updating those tests and running
them should be all that's required, and well see what bugs come out of

Second we need to actually test IronRuby-Rack: given a HttpRequest it
creates a valid rack request, runs the request, and then takes the rack
response and makes into a HttpResponse. We should thoroughly make sure
that's unit tested, and the only way to do that  is write the tests; the
rack tests won't really help. Currently there are some unit tests and a
test similar to rack's webrick test that use Cassini instead. For
starters in testing the HttpRequest portion, we could give it a
HttpRequest and run rack-lint to make sure it doesn't fuck anything up.
But ideally we'll probably need tests exercising the entire rack spec.

This topic is locked and can not be replied to.