# Multiple Ruby versions for testing

**URL:** <https://www.ruby-forum.com/t/multiple-ruby-versions-for-testing/155499>\
**Category:** Ruby\
**Created:** [December 12, 2008, 3:51pm UTC](https://www.ruby-forum.com/t/multiple-ruby-versions-for-testing/155499 "2008-12-12T15:51:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![james-calivar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@james-calivar](https://www.ruby-forum.com/u/james-calivar)\
**Post date:** [December 12, 2008, 3:51pm UTC](https://www.ruby-forum.com/t/multiple-ruby-versions-for-testing/155499/1 "2008-12-12T15:51:15Z")

</div>

Hi list,

I’m trying to test a gem (managed with Hoe) on my Ubuntu machine. The  
Ruby  
from the Ubuntu repos is 1.8.7, but the last version I tested this gem  
on  
was 1.8.6, where all the tests pass. Now some of the tests are failing  
so I  
need to test across multiple versions at once. Can someone point me to a  
decent walk-through on install and running tests against several  
versions of  
Ruby?

---

<div class="post-metadata">

**Author:** ![james-calivar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@james-calivar](https://www.ruby-forum.com/u/james-calivar)\
**Post date:** [December 12, 2008, 3:58pm UTC](https://www.ruby-forum.com/t/multiple-ruby-versions-for-testing/155499/2 "2008-12-12T15:58:53Z")

</div>

Dr. Nic wrote something about this recently.

[http://drnicwilliams.com/2008/12/11/future-proofing-your-ruby-code/](http://drnicwilliams.com/2008/12/11/future-proofing-your-ruby-code/)

Regards,  
Craig

---

<div class="post-metadata">

**Author:** ![james-calivar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@james-calivar](https://www.ruby-forum.com/u/james-calivar)\
**Post date:** [December 12, 2008, 8:22pm UTC](https://www.ruby-forum.com/t/multiple-ruby-versions-for-testing/155499/3 "2008-12-12T20:22:34Z")

</div>

2008/12/12 Craig D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> Dr. Nic wrote something about this recently.
> 
> [http://drnicwilliams.com/2008/12/11/future-proofing-your-ruby-code/](http://drnicwilliams.com/2008/12/11/future-proofing-your-ruby-code/)
> 
> Regards,  
> Craig

Thanks for that. On first running the “multiruby -e ‘p 1+1’” command, it  
downloads 1.8.7 and 1.9.0 then starts building them, but hangs when it  
gets  
to “creating Makefile”. Anybody else get this and know how to fix it? I  
have  
build-essential and ruby1.8-dev installed and the build doesn’t report  
errors, it just hangs.

---

<div class="post-metadata">

**Author:** ![james-calivar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@james-calivar](https://www.ruby-forum.com/u/james-calivar)\
**Post date:** [December 13, 2008, 8:34pm UTC](https://www.ruby-forum.com/t/multiple-ruby-versions-for-testing/155499/4 "2008-12-13T20:34:14Z")

</div>

On Dec 12, 2008, at 11:14 , James C. wrote:

> to “creating Makefile”. Anybody else get this and know how to fix  
> it? I have  
> build-essential and ruby1.8-dev installed and the build doesn’t report  
> errors, it just hangs.

ruby 1.9.0 has a makefile bug that prevents parallel builds from  
working correctly. You can either install one of the latest 1.9  
releases [1], go from trunk, or cd into the build dir and type `make`  
to bypass the bug.

[1] [http://drnicwilliams.com/2008/12/11/future-proofing-your-ruby-code/](http://drnicwilliams.com/2008/12/11/future-proofing-your-ruby-code/)

---

<div class="post-metadata">

**Author:** ![james-calivar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@james-calivar](https://www.ruby-forum.com/u/james-calivar)\
**Post date:** [December 14, 2008, 4:39am UTC](https://www.ruby-forum.com/t/multiple-ruby-versions-for-testing/155499/5 "2008-12-14T04:39:36Z")

</div>

> Can someone point me to a decent walk-through on install  
> and running tests against several versions of Ruby?

I wouldn’t recommending “my” way of doing it but I compile Ruby  
into versioned directories (from source), i.e. under  
/Programs/Ruby/1.9.0 for instance. A symlink will point to the version  
to use, to switch versions one just adjusts the symlink (and  
“resymlinks” in case one follows something akin to  
[http://www.gobolinux.org/](http://www.gobolinux.org/) )

However, I think pretty all Linux distributions do not enjoy this idea  
and instead scatter files into /usr prefix (when it comes from the  
“package manager” of the distribution in question), or /usr/local (if a  
user compiled on his own, though many people use $HOME prefix, and some  
even use /opt which I find extremely peculiar since I saw some  
distributions using pseudo-versioned dirs inside /opt i.e. “/opt/kde3”  
…)
