# Load a local gem while an older lib version still exists

**URL:** <https://www.ruby-forum.com/t/load-a-local-gem-while-an-older-lib-version-still-exists/158819>\
**Category:** Ruby\
**Created:** [January 28, 2009, 12:33pm UTC](https://www.ruby-forum.com/t/load-a-local-gem-while-an-older-lib-version-still-exists/158819 "2009-01-28T12:33:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edouard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c57346/32.png) [@edouard](https://www.ruby-forum.com/u/edouard)\
**Post date:** [January 28, 2009, 12:33pm UTC](https://www.ruby-forum.com/t/load-a-local-gem-while-an-older-lib-version-still-exists/158819/1 "2009-01-28T12:33:04Z")

</div>

Hi

I have installed the mechanize 0.9.0.gem on ubuntu.

The older mechanize-hpricot installed from the ubuntu repository is  
still the default.

How can i load/make the new version the default?

Note that i want to keep the old one because i have already written a  
few things that need it.

thanks for your comments

---

<div class="post-metadata">

**Author:** ![edouard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c57346/32.png) [@edouard](https://www.ruby-forum.com/u/edouard)\
**Post date:** [January 28, 2009, 3:06pm UTC](https://www.ruby-forum.com/t/load-a-local-gem-while-an-older-lib-version-still-exists/158819/2 "2009-01-28T15:06:20Z")

</div>

2009/1/28 Edouard D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Hi
> 
> I have installed the mechanize 0.9.0.gem on ubuntu.
> 
> The older mechanize-hpricot installed from the ubuntu repository is  
> still the default.
> 
> How can i load/make the new version the default?

Assuming the gem name is “mechanize”, put this  
_before_ calling require:

```
gem "mechanize", ">= 0.9.0"

```

> Note that i want to keep the old one because i have already written a  
> few things that need it.
> 
> thanks for your comments

Stefan
