# Bundler

**URL:** <https://www.ruby-forum.com/t/bundler/190359>\
**Category:** IronRuby\
**Created:** [June 18, 2010, 1:21pm UTC](https://www.ruby-forum.com/t/bundler/190359 "2010-06-18T13:21:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dereke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ecd19e/32.png) [@dereke](https://www.ruby-forum.com/u/dereke)\
**Post date:** [June 18, 2010, 1:21pm UTC](https://www.ruby-forum.com/t/bundler/190359/1 "2010-06-18T13:21:06Z")

</div>

I have IronRuby 1.0 with RubyGems 1.3.6 and Bundler 0.9.25.

When I run Bundler.setup I get this error:

NameError: undefined method `gem' for module`Bundler::SharedHelpers’  
from  
C:/IronRuby-1.0/lib/ironruby/gems/1.8/gems/bundler-0.9.25/lib/bundler/shared\_helpers.rb:90:in  
`reverse_rubygems_kernel_mixin' from C:/IronRuby-1.0/lib/ironruby/gems/1.8/gems/bundler-0.9.25/lib/bundler/shared_helpers.rb:84:in`module\_eval’  
from  
C:/IronRuby-1.0/lib/ironruby/gems/1.8/gems/bundler-0.9.25/lib/bundler/shared\_helpers.rb:84:in  
`reverse_rubygems_kernel_mixin' from C:/IronRuby-1.0/lib/ironruby/gems/1.8/gems/bundler-0.9.25/lib/bundler/shared_helpers.rb:95:in`cripple\_rubygems’  
from  
C:/IronRuby-1.0/lib/ironruby/gems/1.8/gems/bundler-0.9.25/lib/bundler/runtime.rb:18:in  
`setup' from C:/IronRuby-1.0/lib/ironruby/gems/1.8/gems/bundler-0.9.25/lib/bundler.rb:76:in`gem\_setup’  
from (irb):3  
from C:/IronRuby-1.0/lib/ruby/1.8/irb.rb:150:in `eval_input' from C:/IronRuby-1.0/lib/ruby/1.8/irb.rb:263:in`signal\_status’  
from C:/IronRuby-1.0/lib/ruby/1.8/irb.rb:147:in `eval_input' from C:/IronRuby-1.0/lib/ruby/1.8/irb.rb:146:in`eval\_input’  
from C:/IronRuby-1.0/lib/ruby/1.8/irb.rb:70:in `start' from C:/IronRuby-1.0/lib/ruby/1.8/irb.rb:69:in`catch’  
from C:/IronRuby-1.0/lib/ruby/1.8/irb.rb:69:in `start’  
from C:/IronRuby-1.0/bin/irb:13

reverse\_rubygems\_kernel\_mixin looks like this:  
def reverse\_rubygems\_kernel\_mixin  
# Disable rubygems’ gem activation system  
::Kernel.class\_eval do  
if private\_method\_defined?(:gem\_original\_require)  
alias rubygems\_require require  
alias require gem\_original\_require  
end

```
    undef gem
  end
end

```

If I run this in irb I get this error:  
NameError: undefined method `gem' for class`Object’

```
  ::Kernel.class_eval do
    undef gem
  end

```

Any ideas?

---

<div class="post-metadata">

**Author:** ![dereke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ecd19e/32.png) [@dereke](https://www.ruby-forum.com/u/dereke)\
**Post date:** [June 18, 2010, 2:00pm UTC](https://www.ruby-forum.com/t/bundler/190359/2 "2010-06-18T14:00:25Z")

</div>

## try doing a require ‘rubygems’ as first line in your file. That should make the gem method available

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([IronRuby in Action - Ivan Porto Carrero and Adam Burmister | Manning](http://manning.com/carrero))  
Microsoft IronRuby/C# MVP

---

<div class="post-metadata">

**Author:** ![dereke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ecd19e/32.png) [@dereke](https://www.ruby-forum.com/u/dereke)\
**Post date:** [June 18, 2010, 6:32pm UTC](https://www.ruby-forum.com/t/bundler/190359/3 "2010-06-18T18:32:41Z")

</div>

Looks like IronRuby bug. This works in MRI but doesn’t in IronRuby:

module Kernel  
def gem  
end  
end

module M  
Kernel.class\_eval do  
p method(:gem)  
undef gem  
end  
end

Will look at it. Thanks for reporting the issue.

Tomas

---

<div class="post-metadata">

**Author:** ![dereke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ecd19e/32.png) [@dereke](https://www.ruby-forum.com/u/dereke)\
**Post date:** [June 20, 2010, 4:44am UTC](https://www.ruby-forum.com/t/bundler/190359/4 "2010-06-20T04:44:12Z")

</div>

Should be fixed now in our internal repo. You can apply the attached  
patch if you want to try it before we push the sources out.

Tomas

---

<div class="post-metadata">

**Author:** ![dereke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ecd19e/32.png) [@dereke](https://www.ruby-forum.com/u/dereke)\
**Post date:** [June 21, 2010, 9:36am UTC](https://www.ruby-forum.com/t/bundler/190359/5 "2010-06-21T09:36:46Z")

</div>

Tomas where do I find your internal repo?  
I had a look on github but there do not seem to be any recent commits.

Tomas M. wrote:

> Should be fixed now in our internal repo. You can apply the attached  
> patch if you want to try it before we push the sources out.
> 
> Tomas

---

<div class="post-metadata">

**Author:** ![dereke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ecd19e/32.png) [@dereke](https://www.ruby-forum.com/u/dereke)\
**Post date:** [June 18, 2010, 2:40pm UTC](https://www.ruby-forum.com/t/bundler/190359/6 "2010-06-18T14:40:15Z")

</div>

I already am:

require ‘rubygems’  
require ‘bundler’  
Bundler.setup

I have also applied this fix (if it makes a difference)  
[http://marcinobel.com/index.php/bug-invalid-exec\_format-ir/](http://marcinobel.com/index.php/bug-invalid-exec_format-ir/)

Other than that it is a fresh IronRuby 1.0 install

---

<div class="post-metadata">

**Author:** ![dereke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ecd19e/32.png) [@dereke](https://www.ruby-forum.com/u/dereke)\
**Post date:** [June 21, 2010, 6:34pm UTC](https://www.ruby-forum.com/t/bundler/190359/7 "2010-06-21T18:34:38Z")

</div>

This will be pushed out by end of the day.

JD

* * *

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[removed\_email\_address@domain.invalid] on behalf of Derek Ekins  
[removed\_email\_address@domain.invalid]  
Sent: Monday, June 21, 2010 12:36 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] Bundler

Tomas where do I find your internal repo?  
I had a look on github but there do not seem to be any recent commits.

Tomas M. wrote:

> Should be fixed now in our internal repo. You can apply the attached  
> patch if you want to try it before we push the sources out.
> 
> Tomas

–  
Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)
