views:

78

answers:

3

I'm trying to install Cucumber with ironruby. I followed instructions from http://wiki.github.com/aslakhellesoy/cucumber/ironruby-and-net . It downloads version 0.8.3 of cucumber and version 2.0.2 of gherkin. When i run cucumber i get the following error:

c:/ironruby/lib/ironruby/gems/1.8/gems/gherkin-2.0.2-universal-dotnet/lib/gherki
n/native/ikvm.rb:16:in `load_assembly': Assembly 'gherkin' not found\nTry this:
SET MONO_PATH=c:/ironruby/lib/ironruby/gems/1.8/gems/gherkin-2.0.2-universal-dot
net/lib (or export MONO_PATH=...) (LoadError)
        from c:/ironruby/lib/ironruby/gems/1.8/gems/gherkin-2.0.2-universal-dotn
et/lib/gherkin/native/ikvm.rb:16:in `native_impl'
        from c:/ironruby/lib/ironruby/gems/1.8/gems/gherkin-2.0.2-universal-dotn
et/lib/gherkin/i18n.rb:7
        from c:/ironruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
 `require'
        from c:/ironruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
 `require'
        from c:/ironruby/lib/ironruby/gems/1.8/gems/gherkin-2.0.2-universal-dotn
et/lib/gherkin/i18n_lexer.rb:1
        from c:/ironruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
 `require'
        from c:/ironruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
 `require'
        from c:/ironruby/lib/ironruby/gems/1.8/gems/gherkin-2.0.2-universal-dotn
et/lib/gherkin.rb:1
        from c:/ironruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
 `require'
        from c:/ironruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
 `require'
        from c:/ironruby/lib/ironruby/gems/1.8/gems/cucumber-0.8.3/bin/../lib/cu
cumber/cli/main.rb:5
        from c:/ironruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
 `require'
        from c:/ironruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
 `require'
        from c:/ironruby/lib/ironruby/gems/1.8/gems/cucumber-0.8.3/bin/cucumber:
5
        from C:/ironruby/bin/cucumber:19:in `load'
        from C:/ironruby/bin/cucumber:19

I've tried to set the MONO_PATH but that didn't seem to work. Any ideas?

A: 

I've been meaning to look into that. I think it has something to do with the new Ragel-based parser (Gherkin). It is compiled to a Java class, then compiled to a .NET assembly via IKVM. I think that in the process, it is taking a dependency on Mono.

Will Green
Ah, Cucumber with IronRuby somehow doesn't seem production ready to me just yet :)
arneeiri
SpecFlow uses the same Gherkin parser for on .NET and Mono and there it works fine. There must be another issue that causes this.
Gaspar Nagy
Yes, I think that the Ruby code that wraps loading this assembly for IronRuby makes some assumptions about the environment (judging by the error messages it spits out when it fails to load the assembly) that do not hold true if you don't have Mono installed.
Will Green
+1  A: 

I ran into this problem as well. The solution is to downgrade both cucumber and gherkin. Install gherkin 1.0.27 and cucumber 0.6.4 and it works. For reference: http://github.com/aslakhellesoy/gherkin/issues/issue/63

Nick
Yes, but current version of Gherkin is 2.2.8, and Cucumber is 0.9.2. Don't be surprised if examples don't work when you use such old versions of both...
Will Green
A: 

Well, you can get past that particular bug using this gist as the test runner:

http://gist.github.com/465677

Unfortunately, it then produces another error.

Julian Birch
Yes, this isn't an answer, but I'm hoping it'll help someone... :)
Julian Birch