[Ironruby-core] Assistance Needed Running IronRuby.Rack.Example

Jimmy Schementi Jimmy.Schementi at microsoft.com
Tue Jun 23 17:40:10 EDT 2009


> -----Original Message-----
> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-
> bounces at rubyforge.org] On Behalf Of Ted Milker
> Sent: Tuesday, June 23, 2009 1:07 PM
> To: ironruby-core at rubyforge.org
> Subject: [Ironruby-core] Assistance Needed Running IronRuby.Rack.Example
>
> Could I get some assistance in running rack on IronRuby?  I am just trying out:
>
> http://github.com/jschementi/ironruby/tree/master/Merlin/Main/Hosts/Iro
> nRuby.Rack
>
> from RailsConf, not the latest one from the IronRuby tree.

I'm pretty sure both versions are identical, so you can pick either one.

> Everything has
> built successfully and I had to modify Web.config to point to my MRI 1.8
> installation directory but this is as far as I can get.  I have tried both igem
> install rack and gem install rack but I still receive this message.  Running on
> IIS7 under Windows Vista 64bit.  I do not have any release versions of
> IronRuby installed on this machine.  I did not have a IIS_IUSER to assign
> permissions to but I did try assigning read/execute permissions to the
> IIS_IUSRS group with no change.

Woops, I got the IIS_IUSRS name wrong ... I'll change the README to reflect that.

> Assuming I can get this to work, could I also get some instructions on how to
> run Sinatra on top of this?

It worked the first time on my machine, so let's figure out what's different ...

>
> Error: Gem::LoadError
>
> c:/progra~2/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:826:in
> `report_activate_error': Could not find RubyGem rack (= 1.0.0)
>  (Gem::LoadError)

So, it finds RubyGems (which is good, that means the paths are set up properly) but it doesn't find the Rack gem. Sounds like it wouldn't be able to find any gems ... if you executed this from the immediate window it would probably throw an error too:

RubyEngine.Require("sinatra")

However, the issue you see is completely my fault. Take a look at line 43 of Application.cs: http://github.com/jschementi/ironruby/blob/fc84e8dc9d563b7dde9cd7c2506488f190f98c3b/Merlin/Main/Hosts/IronRuby.Rack/Application.cs#L43

    // HACK Load gems from default MRI installation. This shouldn't be needed.
    Environment.SetEnvironmentVariable("GEM_PATH", @"C:\ruby\lib\ruby\gems\1.8");

I'm being pretty evil here and setting GEM_PATH over your head. This line should be set to "c:\progra~2\ruby\lib\ruby\gems\1.8" for you if you want to use MRI's gems, or the path to rubygems that IronRuby sets up (do a "echo %GEM_PATH% from Dev.bat to get that value). A simple recompile should make things work again.

I'll pull GEM_PATH out into a setting in web.config so this doesn't suck. =P Thanks for reporting it!

~js

>         from c:/progra~2/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:260:in
> `activate'
>         from c:/progra~2/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:67:in `gem'
>         from :0
>         from C:\src\Merlin\Main\Hosts\IronRuby.Rack\RubyEngine.cs:43:in
> `Execute'
>         from C:\src\Merlin\Main\Hosts\IronRuby.Rack\RubyEngine.cs:39:in
> `Execute'
>         from C:\src\Merlin\Main\Hosts\IronRuby.Rack\RubyEngine.cs:31:in
> `Require'
>         from C:\src\Merlin\Main\Hosts\IronRuby.Rack\Application.cs:49:in
> `InitRack'
>         from C:\src\Merlin\Main\Hosts\IronRuby.Rack\Application.cs:28:in `.ctor'
>         from
> C:\src\Merlin\Main\Hosts\IronRuby.Rack\HttpHandlerFactory.cs:41:in
> `GetHandler'
>         from System.Web:0:in
> `System.Web.HttpApplication.IExecutionStep.Execute'
>         from System.Web:0:in `ExecuteStep'
>         from System.Web:0:in `ResumeSteps'
>         from System.Web:0:in `BeginProcessRequestNotification'
>         from System.Web:0:in `ProcessRequestNotificationPrivate'
>         from System.Web:0:in `ProcessRequestNotificationHelper'
>         from System.Web:0:in `ProcessRequestNotification'
>         from System.Web:0:in `ProcessRequestNotificationHelper'
>         from System.Web:0:in `ProcessRequestNotification'
>
> Search paths
>
> C:/src/Merlin/Main/Hosts/IronRuby.Rack/IronRuby.Rack.Example
> C:/src/Merlin/Main/Languages/Ruby/Libs
> c:/progra~2/ruby/lib/ruby/site_ruby/1.8
> c:/progra~2/ruby/lib/ruby/site_ruby
> c:/progra~2/ruby/lib/ruby/1.8




More information about the Ironruby-core mailing list