Forum: Ruby load a local gem while an older lib version still exists

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
25ae00f7825b9b6ddc7db1fb7b589f34?d=identicon&s=25 Edouard Dantes (edouard)
on 2009-01-28 12:33
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
40613e55d7082e5f08429dfb50d0680e?d=identicon&s=25 Stefan Lang (Guest)
on 2009-01-28 15:06
(Received via mailing list)
2009/1/28 Edouard Dantes <edrd.dantes@gmail.com>:
> 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
This topic is locked and can not be replied to.