# Gem installation-time dependency

**URL:** <https://www.ruby-forum.com/t/gem-installation-time-dependency/174361>\
**Category:** Ruby\
**Created:** [August 25, 2009, 5:08pm UTC](https://www.ruby-forum.com/t/gem-installation-time-dependency/174361 "2009-08-25T17:08:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@mark](https://www.ruby-forum.com/u/mark)\
**Post date:** [August 25, 2009, 5:08pm UTC](https://www.ruby-forum.com/t/gem-installation-time-dependency/174361/1 "2009-08-25T17:08:00Z")

</div>

Is there a way to build a gem in such a way so that dependencies can be  
resolved at installation-time?

I want users to be able to “gem install ruby-debug-ide”, and have the  
ruby-debug-ide gem install either ruby-debug-base or ruby-debug-base19,  
depending on the version of Ruby that they’re running.

I’m thinking maybe extconf.rb could do this, but just wanted to see if  
anyone had any ideas.

---

<div class="post-metadata">

**Author:** ![mark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@mark](https://www.ruby-forum.com/u/mark)\
**Post date:** [August 26, 2009, 5:59am UTC](https://www.ruby-forum.com/t/gem-installation-time-dependency/174361/2 "2009-08-26T05:59:09Z")

</div>

Well, if anyone’s curious, I figured it out. Take a look at the  
ruby-debug-ide19 gem. It works for both Ruby 1.8 and 1.9, detecting the  
dependencies at install time.

---

<div class="post-metadata">

**Author:** ![mark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@mark](https://www.ruby-forum.com/u/mark)\
**Post date:** [August 26, 2009, 8:50pm UTC](https://www.ruby-forum.com/t/gem-installation-time-dependency/174361/3 "2009-08-26T20:50:11Z")

</div>

On Aug 26, 2009, at 08:12, Mark M. wrote:

> anyone had any ideas.  
> Why isn’t ruby-debug-base “fat” (containing both 1.8 and 1.9 code)?

See also:

[http://tenderlovemaking.com/2009/05/07/fat-binary-gems-make-the-rockin-world-go-round/](http://tenderlovemaking.com/2009/05/07/fat-binary-gems-make-the-rockin-world-go-round/)

---

<div class="post-metadata">

**Author:** ![mark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@mark](https://www.ruby-forum.com/u/mark)\
**Post date:** [September 5, 2009, 5:05pm UTC](https://www.ruby-forum.com/t/gem-installation-time-dependency/174361/4 "2009-09-05T17:05:23Z")

</div>

Eric H. wrote:

> On Aug 26, 2009, at 08:12, Mark M. wrote:
> 
> > anyone had any ideas.  
> > Why isn’t ruby-debug-base “fat” (containing both 1.8 and 1.9 code)?
> 
> See also:
> 
> [http://tenderlovemaking.com/2009/05/07/fat-binary-gems-make-the-rockin-world-go-round/](http://tenderlovemaking.com/2009/05/07/fat-binary-gems-make-the-rockin-world-go-round/)

I’d like it to be, but that’s up to Kent S. and Rocky B.,  
the admins of that gem. I asked Rocky a few weeks ago about including my  
changes into linecache, but he’s not comfortable with the approach that  
I took. I admit that it’s hackish and needs to be revisited.

Mark

---

<div class="post-metadata">

**Author:** ![mark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@mark](https://www.ruby-forum.com/u/mark)\
**Post date:** [September 5, 2009, 5:20pm UTC](https://www.ruby-forum.com/t/gem-installation-time-dependency/174361/5 "2009-09-05T17:20:48Z")

</div>

On Aug 26, 8:47 pm, Eric H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > I’m thinking maybe extconf.rb could do this, but just wanted to see if  
> > anyone had any ideas.
> 
> Why isn’t ruby-debug-base “fat” (containing both 1.8 and 1.9 code)?
> 
> See also:
> 
> [http://tenderlovemaking.com/2009/05/07/fat-binary-gems-make-the-rocki](http://tenderlovemaking.com/2009/05/07/fat-binary-gems-make-the-rocki)…

The approach Aaron took there has been integrated in rake-compiler  
already, so is more easy now to generate fat binaries.

Cheers,
