# Ironruby.rack patch

**URL:** <https://www.ruby-forum.com/t/ironruby-rack-patch/184937>\
**Category:** IronRuby\
**Created:** [March 10, 2010, 4:47pm UTC](https://www.ruby-forum.com/t/ironruby-rack-patch/184937 "2010-03-10T16:47:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xjivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/6f9a4e/32.png) [@xjivan](https://www.ruby-forum.com/u/xjivan)\
**Post date:** [March 10, 2010, 4:47pm UTC](https://www.ruby-forum.com/t/ironruby-rack-patch/184937/1 "2010-03-10T16:47:15Z")

</div>

HI

I needed IronRuby.Rack today so I patched it to work without  
GetExecutionContext

## the patch is attached

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([http://manning.com/carrero](http://manning.com/carrero))  
Microsoft IronRuby/C# MVP

---

<div class="post-metadata">

**Author:** ![xjivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/6f9a4e/32.png) [@xjivan](https://www.ruby-forum.com/u/xjivan)\
**Post date:** [March 10, 2010, 8:29pm UTC](https://www.ruby-forum.com/t/ironruby-rack-patch/184937/2 "2010-03-10T20:29:04Z")

</div>

Thanks! Iâ€™ve already added something equivalent, but havenâ€™t checked it  
in; Iâ€™ll get to it soon. For anyone else who needs this, just apply  
Ivanâ€™s patch for now.  
From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ivan Porto  
Carrero  
Sent: Wednesday, March 10, 2010 7:46 AM  
To: ironruby-core  
Subject: [Ironruby-core] ironruby.rack patch

HI

I needed IronRuby.Rack today so I patched it to work without  
GetExecutionContext

## the patch is attached

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([IronRuby in Action - Ivan Porto Carrero and Adam Burmister | Manning](http://manning.com/carrero))  
Microsoft IronRuby/C# MVP

---

<div class="post-metadata">

**Author:** ![xjivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/6f9a4e/32.png) [@xjivan](https://www.ruby-forum.com/u/xjivan)\
**Post date:** [March 10, 2010, 10:06pm UTC](https://www.ruby-forum.com/t/ironruby-rack-patch/184937/3 "2010-03-10T22:06:14Z")

</div>

But I still wasn’t able to run my rails app from IIS.

I modified my IronRuby.Rack version to have web.config etc in the public  
folder but [config.ru](http://config.ru) in the rackup folder. That’s the way passenger does  
it  
too and that makes absolute paths for images, stylesheets etc will work  
out  
better.

But regardless of what I use the original code + the earlier sent patch.  
Or  
the one that starts in public I get this error when it’s trying to run a  
rails app

[http://gist.github.com/328343](http://gist.github.com/328343)

## [http://gist.github.com/328343](http://gist.github.com/328343)Any help/pointers you can give me would be greatly appreciated

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([IronRuby in Action - Ivan Porto Carrero and Adam Burmister | Manning](http://manning.com/carrero))  
Microsoft IronRuby/C# MVP

On Wed, Mar 10, 2010 at 8:24 PM, Jimmy S. \<

---

<div class="post-metadata">

**Author:** ![xjivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/6f9a4e/32.png) [@xjivan](https://www.ruby-forum.com/u/xjivan)\
**Post date:** [May 16, 2010, 11:33am UTC](https://www.ruby-forum.com/t/ironruby-rack-patch/184937/4 "2010-05-16T11:33:06Z")

</div>

Ivan, did you ever figure this out? The problem is that rails-2.3.5  
ships with a private copy of rack-1.0.1. However, if you have the latest  
version of rack installed too (rack-1.1.0), IronRuby.Rack by default  
will load the latest version \>=1.0.0 (meaning 1.1.0), but then rails  
will fail to load its own copy when booting. To prevent this, install  
rack-1.0.1 and force it to be loaded by IronRuby.Rack by specifying the  
â€œRackVersionâ€ in web.configâ€™s appSettings:

WRT the public folder, I prefer a slightly different solution: [config.ru](http://config.ru)  
and web.config in the same directory, but web.config will have an option  
for telling IronRuby.Rack what folder it should serve static content out  
of, and by default it will be â€œpublicâ€. I wouldnâ€™t consider web.config  
static content, so Iâ€™d prefer keeping it out of the public folder.

In fact, the version of IronRuby.Rack in GIT does not support requesting  
static files at all, as all requests are routed through IronRuby.Rack  
and nowhere does it say â€œif requested file exists: serve it and finish  
requestâ€. If youâ€™ve run a rails app through IronRuby.Rack and havenâ€™t  
seen images, thatâ€™s why, but will be fixed once we push new bits to GIT.

~js

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ivan Porto  
Carrero  
Sent: Wednesday, March 10, 2010 1:05 PM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] ironruby.rack patch

But I still wasn’t able to run my rails app from IIS.

I modified my IronRuby.Rack version to have web.config etc in the public  
folder but [config.ru](http://config.ru)[http://config.ru](http://config.ru) in the rackup folder. That’s the  
way passenger does it too and that makes absolute paths for images,  
stylesheets etc will work out better.

But regardless of what I use the original code + the earlier sent patch.  
Or the one that starts in public I get this error when it’s trying to  
run a rails app

[http://gist.github.com/328343](http://gist.github.com/328343)

## Any help/pointers you can give me would be greatly appreciated

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([IronRuby in Action - Ivan Porto Carrero and Adam Burmister | Manning](http://manning.com/carrero))  
Microsoft IronRuby/C# MVP

On Wed, Mar 10, 2010 at 8:24 PM, Jimmy S.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>  
wrote:  
Thanks! Iâ€™ve already added something equivalent, but havenâ€™t checked it  
in; Iâ€™ll get to it soon. For anyone else who needs this, just apply  
Ivanâ€™s patch for now.  
From:  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
On Behalf Of Ivan Porto C.  
Sent: Wednesday, March 10, 2010 7:46 AM  
To: ironruby-core  
Subject: [Ironruby-core] ironruby.rack patch

HI

I needed IronRuby.Rack today so I patched it to work without  
GetExecutionContext

## the patch is attached

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([IronRuby in Action - Ivan Porto Carrero and Adam Burmister | Manning](http://manning.com/carrero))  
Microsoft IronRuby/C# MVP

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)
