# IronRuby and Cucumber - undefined method \`bin\_path' for Gem:Module (NoMethodError)

**URL:** <https://www.ruby-forum.com/t/ironruby-and-cucumber-undefined-method-bin-path-for-gem-module-nomethoderror/167453>\
**Category:** IronRuby\
**Created:** [May 7, 2009, 9:57pm UTC](https://www.ruby-forum.com/t/ironruby-and-cucumber-undefined-method-bin-path-for-gem-module-nomethoderror/167453 "2009-05-07T21:57:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Otto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@Matt\_Otto](https://www.ruby-forum.com/u/Matt_Otto)\
**Post date:** [May 7, 2009, 9:57pm UTC](https://www.ruby-forum.com/t/ironruby-and-cucumber-undefined-method-bin-path-for-gem-module-nomethoderror/167453/1 "2009-05-07T21:57:21Z")

</div>

Hello,

I’m running into the following issue trying to run cucumber with the  
latest iron ruby source from git:  
c:/ruby/bin/cucumber:19: undefined method `bin\_path’ for Gem:Module  
(NoMethodError)

This occurs when running either icucumber --help or the i18n cucumber  
sample. I’ve not tried any of the other examples.

Yesterday morning I was able to get the scenarios in the i18n examples  
to partially execute until they failed with  
“Unable to cast from Func to BlockCallTargetN” and :0:in `concat’:  
can’t modify frozen object (TypeError)". exceptions, but after  
updating this morning I’m only seeing the undefined method exception.

I’m currently sharing gems between MRI and Iron Ruby if that matters,  
and am using the instructions found here for cucumber:  
[http://wiki.github.com/aslakhellesoy/cucumber/ironruby-and-net](http://wiki.github.com/aslakhellesoy/cucumber/ironruby-and-net)

Does anyone have any ideas? Or should I file a bug for this on  
CodePlex? Also if you need more information let me know.

Thanks in advance,  
Matt

---

<div class="post-metadata">

**Author:** ![Matt\_Otto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@Matt\_Otto](https://www.ruby-forum.com/u/Matt_Otto)\
**Post date:** [May 7, 2009, 11:43pm UTC](https://www.ruby-forum.com/t/ironruby-and-cucumber-undefined-method-bin-path-for-gem-module-nomethoderror/167453/2 "2009-05-07T23:43:04Z")

</div>

I added the following to [http://ironruby.net/Support](http://ironruby.net/Support). Could you send the  
exception information as described below?

Bugs

If you encounter a bug in IronRuby, or would like to ask for a feature,  
please submit an  
issue[http://ironruby.codeplex.com/WorkItem/Create.aspx](http://ironruby.codeplex.com/WorkItem/Create.aspx) to the IronRuby  
CodePlex project[http://ironruby.codeplex.com](http://ironruby.codeplex.com). A good bug report should  
include as much of the following information as possible:

- IronRuby version - This is the output of “ir.exe -v” for binary  
releases, or the date and time when you did a GIT pull if you are  
building from sources, and if it is a Debug build or a Release build
- Platform - Version of CLR, OS, machine type
- MRI results - For pure Ruby code, does it work with ruby.exe
- Exception information  
\* For cases where the exception backtrace is printed to the scree,  
full output of “ir.exe -ExceptionDetail”  
\* For cases where the application catches the exception, or if the  
backtrace is not accurate, the call stack from the Call Stack window in  
VS after running using “ir.exe -D”, and enabling catching of all  
Exceptions under the “Debug” menu.

Thanks,

Shri

---

<div class="post-metadata">

**Author:** ![Matt\_Otto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@Matt\_Otto](https://www.ruby-forum.com/u/Matt_Otto)\
**Post date:** [May 14, 2009, 6:29pm UTC](https://www.ruby-forum.com/t/ironruby-and-cucumber-undefined-method-bin-path-for-gem-module-nomethoderror/167453/3 "2009-05-14T18:29:54Z")

</div>

I just copied the the bin\_path code from  
C:\path\to\ruby\lib\ruby\site\_ruby\1.8\rubygems.rb to  
\path\to\ironruby\libraries\lib\ruby\site\_ruby\1.8\rubygems.rb and it  
works fine with cucumber but I am now getting some new errors with a  
frozen object being called.

I have also fixed the problem with expand\_path I removed Path and used a  
stack and parsed the path myself but I am a contributing noob and not  
sure really how to add this.

But I was able to get rspec running with my .net code. I made a bat that  
calls spec (in ruby folder) mycode.rb using ironruby

Matt Otto wrote:

> Hello,
> 
> I’m running into the following issue trying to run cucumber with the  
> latest iron ruby source from git:  
> c:/ruby/bin/cucumber:19: undefined method `bin\_path’ for Gem:Module  
> (NoMethodError)
> 
> This occurs when running either icucumber --help or the i18n cucumber  
> sample. I’ve not tried any of the other examples.
> 
> Yesterday morning I was able to get the scenarios in the i18n examples  
> to partially execute until they failed with  
> “Unable to cast from Func to BlockCallTargetN” and :0:in `concat’:  
> can’t modify frozen object (TypeError)". exceptions, but after  
> updating this morning I’m only seeing the undefined method exception.
> 
> I’m currently sharing gems between MRI and Iron Ruby if that matters,  
> and am using the instructions found here for cucumber:  
> [http://wiki.github.com/aslakhellesoy/cucumber/ironruby-and-net](http://wiki.github.com/aslakhellesoy/cucumber/ironruby-and-net)
> 
> Does anyone have any ideas? Or should I file a bug for this on  
> CodePlex? Also if you need more information let me know.
> 
> Thanks in advance,  
> Matt

---

<div class="post-metadata">

**Author:** ![Matt\_Otto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@Matt\_Otto](https://www.ruby-forum.com/u/Matt_Otto)\
**Post date:** [May 14, 2009, 7:25pm UTC](https://www.ruby-forum.com/t/ironruby-and-cucumber-undefined-method-bin-path-for-gem-module-nomethoderror/167453/4 "2009-05-14T19:25:49Z")

</div>

Thanks for reporting these issues. I’m well aware of these issues with  
running Cucumber, and am working on getting it running today. The  
“frozen object” issue is with optparse, and Shri already has a fix for  
it. I’ll get the instructions updated on the cucumber wiki to run it  
with IronRuby.

Merrell, if you have a fix to expand\_path, please commit/push it to your  
fork of IronRuby and send a link to the commit + some description to  
this list. More detailed instructions are here:  
[http://wiki.github.com/ironruby/ironruby/contributing](http://wiki.github.com/ironruby/ironruby/contributing).

~js
