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

Ted Milker tmilker at gmail.com
Wed Jun 24 08:57:51 EDT 2009

On Tue, Jun 23, 2009 at 4:40 PM, Jimmy
Schementi<Jimmy.Schementi at microsoft.com> wrote:
>    // 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.

Yep, that did it.  I just updated the path to reflect my MRI install
and it is working now. I am sure this has been covered on the list and
I am just forgetting, but igem is just a way to manage a separate set
of installed gems, correct? There is nothing special about the gems it
retrieves vs. the ones from an MRI install?

Now, on to what I really wanted to do, run Sinatra.  I tried a simple
Hello World but I get a YSOD about an undefined method 'call'.  I
modified config.ru to require my new .rb file and tried both:

require 'rubygems'
require 'sinatra'

class App
    get '/' do
        'Hello world!'

and after commenting out App.new in config.ru:

require 'rubygems'
require 'sinatra'

get '/' do
    'Hello world!'

but they both give a similar stack trace:

Server Error in '/IronRuby.Rack.Example' Application.

undefined method `call' for #<App:0x0000536>

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.MissingMethodException: undefined method
`call' for #<App:0x0000536>

Source Error:

Line 458:        public static object MethodMissing(RubyContext/*!*/
context, object/*!*/ self, SymbolId symbol, [NotNull]params
object[]/*!*/ args) {
Line 459:            string name = SymbolTable.IdToString(symbol);
Line 460:            throw RubyExceptions.CreateMethodMissing(context,
self, name);
Line 461:        }
Line 462:

Source File: C:\src\Merlin\Main\Languages\Ruby\Libraries.LCA_RESTRICTED\Builtins\KernelOps.cs
   Line: 460

Stack Trace:

[MissingMethodException: undefined method `call' for #<App:0x0000536>]
   IronRuby.Builtins.KernelOps.MethodMissing(RubyContext context,
Object self, SymbolId symbol, Object[] args) in
   CallSite.Target(Closure , CallSite , Object , Object ) +317
   System.Dynamic.UpdateDelegates.UpdateAndExecute2(CallSite site, T0
arg0, T1 arg1) in
obj, String memberName, Boolean ignoreCase, Object[] parameters) in
obj, String memberName, Object[] parameters) in
obj, String memberName, Object[] parameters) in
   IronRuby.Rack.RubyEngine.ExecuteMethod(Object instance, String
methodName, Object[] args) in
   IronRuby.Rack.Application.Call(IDictionary`2 env) in
   IronRuby.Rack.Handler.IIS.Handle(Request request, Response
response) in C:\src\Merlin\Main\Hosts\IronRuby.Rack\IIS.cs:238
   IronRuby.Rack.HttpHandler.ProcessRequest(HttpContext context) in
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously) +171

Version Information: Microsoft .NET Framework Version:2.0.50727.3074;
ASP.NET Version:2.0.50727.3074

The only difference is whether the the undefined method is for App or

More information about the Ironruby-core mailing list