Error when running Cucumber examples with IronRuby

Hi,

I have been putting all my might to get the simple examples working with
IronRuby and Cucumber. I followed ironruby-and-net guidlines in the
following link.
http://wiki.github.com/aslakhellesoy/cucumber/ironruby-and-net

All the steps were successful up to the point of running the cucumber
examples.

when I run “icucumber features” after cd to the i18n\en I get the
follwing error.

(eval):220:in _nt_keyword_space': unexpected break (LocalJumpError) from c:\ironruby_source\ironruby\src\IronRuby.Libraries\Builtins\kernelops.cs:432:in loop’
from (eval):211:in _nt_keyword_space' from feature.rb:900:in _nt_step’
from feature.rb:848:in _nt_steps' from c:\ironruby_source\ironruby\src\IronRuby.Libraries\Builtins\kernelops.cs:432:in loop’
from feature.rb:839:in _nt_steps' from feature.rb:763:in _nt_scenario_outline’
from feature.rb:96:in _nt_feature' from c:\ironruby_source\ironruby\src\IronRuby.Libraries\Builtins\kernelops.cs:432:in loop’
from feature.rb:71:in _nt_feature' from c:\ironruby_source\ironruby\src\IronRuby.Libraries\Builtins\kernelops.cs:1259:in send’
from compiled_parser.rb:15:in parse' from treetop_ext.rb:39:in parse_or_fail’
from treetop_ext.rb:28:in parse_file' from treetop_ext.rb:19:in parse_file’
from main.rb:54:in load_plain_text_features' from c:\ironruby_source\ironruby\src\IronRuby.Libraries\Extensions\IListOps.cs:700:in each’
from main.rb:49:in load_plain_text_features' from main.rb:30:in execute!’
from main.rb:19:in execute' from :0 from c:\ironruby_source\ironruby\src\IronRuby.Libraries\Builtins\kernelops.cs:390:in load’
from :0

Thank u very much if somebody can help me on this :slight_smile:

Cheers!!!

src\IronRuby.Libraries is no longer a valid path in the sources. You
must have the old sources. We have moved from SVN to GIT. See
http://wiki.github.com/ironruby/ironruby for the latest instructions.

Jimmy, were you going to delete the SVN sources and put a pointer to the
GIT repo? This is the second instance someone has used the old sources,
so we should go ahead and nuke the SVN sources.

Chamini, do keep us updated on how things go with the latest sources.

The svn sources have been nuked from /trunk. I left the /tags directory
just in case anyone needs the sources to a previous build that isn’t in
git. /trunk now only have one file in it … a README that directs
people to github: http://ironruby.rubyforge.org/svn/trunk.


From: [email protected]
[[email protected]] on behalf of Shri B.
[[email protected]]
Sent: Tuesday, March 31, 2009 2:19 PM
To: [email protected]
Subject: Re: [Ironruby-core] Error when running Cucumber examples with
IronRuby

src\IronRuby.Libraries is no longer a valid path in the sources. You
must have the old sources. We have moved from SVN to GIT. See
http://wiki.github.com/ironruby/ironruby for the latest instructions.

Jimmy, were you going to delete the SVN sources and put a pointer to the
GIT repo? This is the second instance someone has used the old sources,
so we should go ahead and nuke the SVN sources.

Chamini, do keep us updated on how things go with the latest sources.

Hi,

I got the new ironruby source from
http://github.com/ironruby/ironruby/tree/master and built it by Visual
Studio 2008 (with 11 successful, 0 failed and 1 skipped)and tried the
examples. Still I’m getting a simillar kind of error.

C:\ruby\lib\ruby\gems\1.8\gems\cucumber-0.2.3\examples\i18n\en>icucumber
features
*** THIS RUBY IMPLEMENTATION DOESN’T REPORT FILE AND LINE FOR PROCS ***
*** WARNING: You must “gem install win32console” (1.2.0 or higher) to
get coloured output on MRI/Windows
(eval):220:in _nt_keyword_space': unexpected break (LocalJumpError) from :0:in loop’
from (eval):211:in _nt_keyword_space' from feature.rb:900:in _nt_step’
from feature.rb:848:in _nt_steps' from :0:in loop’
from feature.rb:839:in _nt_steps' from feature.rb:763:in _nt_scenario_outline’
from feature.rb:96:in _nt_feature' from :0:in loop’
from feature.rb:71:in _nt_feature' from :0:in send’
from compiled_parser.rb:15:in parse' from treetop_ext.rb:39:in parse_or_fail’
from treetop_ext.rb:28:in parse_file' from c:\ironruby\Merlin\Main\Languages\Ruby\Libraries.LCA_RESTRICTED\Builtins\IoOps.cs:161:in InvokeOpenBlock’
from treetop_ext.rb:19:in parse_file' from main.rb:54:in load_plain_text_features’
from :0:in each' from main.rb:49:in load_plain_text_features’
from main.rb:30:in execute!' from main.rb:19:in execute’
from cucumber:0
from :0:in `load’
from cucumber:0

I tried the same procedure after rake compiling the source as well, but
got the same error.

Ruby, IronRuby and Cucumber seems to be working fine when tested alone.
Any help will be very much appreciated.

Thanx in advance :slight_smile:

Hi,

Thank you very much for the kind support. Now, I’m going ahead with the
new source :). I will be happy to update u as soon as possible :D.

Its an IronRuby bug with “break” in eval’ed code. The problem can be
reproed with the snippet below. Tomas, do you want to take a look?

def f
yield
end

f { break } # This works with both MRI and IronRuby

eval “f { break }” # This throws LocalJumpError with IronRuby only

Thanks,
Shri

Let’s file a bug. We have more control flow issues to be fixed. I’ll fix
them all at once.

Thanks for investigation,
Tomas

Hi,

I have been trying the same task with the latest ironruby source and
continuously get the same error. Can some one please guide me how and
where to apply the snippet mentioned in Shri’s post;

Shri B. wrote:

Its an IronRuby bug with “break” in eval’ed code. The problem can be
reproed with the snippet below. Tomas, do you want to take a look?

def f
yield
end

f { break } # This works with both MRI and IronRuby

eval “f { break }” # This throws LocalJumpError with IronRuby only

Thanks,
Shri

Thanks in advance…

Chamini

Is there a workaround that we can use in the time being? I found where
the exception was being thrown and tried to figure it out myself, but
the codebase is just too foreign me.

Thanks,
Zach

Jimmy S. wrote:

That’s because the bug still exist …
http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=578

~js

Could you modify the cucumber Ruby sources so that it does not use
“break” in evaled code (unless the break is in a loop or a block)? From
the output Chamini had sent before, it looks like “_nt_keyword_space” is
a method defined using eval, and it has the break that is not in a loop
or a block. You could modify the eval code to use some other control
flow instead of a break - like throwing an exception. This will allow
you to find other problems that may be hidden behind this one.

That’s because the bug still exist …
http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=578

~js