# How to use more than one gem version in the same application

**URL:** <https://www.ruby-forum.com/t/how-to-use-more-than-one-gem-version-in-the-same-application/178663>\
**Category:** IT\
**Created:** [November 9, 2009, 5:55am UTC](https://www.ruby-forum.com/t/how-to-use-more-than-one-gem-version-in-the-same-application/178663 "2009-11-09T05:55:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![darshana](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/53a042/32.png) [@darshana](https://www.ruby-forum.com/u/darshana)\
**Post date:** [November 9, 2009, 5:55am UTC](https://www.ruby-forum.com/t/how-to-use-more-than-one-gem-version-in-the-same-application/178663/1 "2009-11-09T05:55:25Z")

</div>

Hi All,

I am using Hpricot library for html parsing.  
The strange thing that I observed is some html parsing is working with  
hpricot gem version 0.6 and some with hpricot gem version 0.8.1.

So, I tried with using specific version of hpricot gem with following  
command:

require ‘rubygems’  
gem ‘hpricot’, ‘= 0.6’

But its giving error:  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems.rb:280:in `activate’: can’t  
activate hpr  
icot (= 0.6, runtime) for [], already activated  
hpricot-0.8.1-x86-mswin32 for []  
(Gem::LoadError)

I want to know how to use more than one gem version in the same ruby  
application?  
Is this feasible, if yes thn how?

Any pointer will be helpful to me.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![darshana](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/53a042/32.png) [@darshana](https://www.ruby-forum.com/u/darshana)\
**Post date:** [November 9, 2009, 3:48pm UTC](https://www.ruby-forum.com/t/how-to-use-more-than-one-gem-version-in-the-same-application/178663/2 "2009-11-09T15:48:15Z")

</div>

I don’t think it’s feasible but as you wrote your question in English  
you probably wanted to post your question to the general Ruby forum at  
[http://www.ruby-forum.com/forum/4](http://www.ruby-forum.com/forum/4) and not to the Italian one at  
[http://www.ruby-forum.com/forum/19](http://www.ruby-forum.com/forum/19)  
You’ll also find more people to advise you there.

Regards  
Paolo

Darshana G. wrote:

> Hi All,
> 
> I am using Hpricot library for html parsing.  
> The strange thing that I observed is some html parsing is working with  
> hpricot gem version 0.6 and some with hpricot gem version 0.8.1.
> 
> So, I tried with using specific version of hpricot gem with following  
> command:
> 
> require ‘rubygems’  
> gem ‘hpricot’, ‘= 0.6’
> 
> But its giving error:  
> c:/ruby/lib/ruby/site\_ruby/1.8/rubygems.rb:280:in `activate’: can’t  
> activate hpr  
> icot (= 0.6, runtime) for , already activated  
> hpricot-0.8.1-x86-mswin32 for   
> (Gem::LoadError)
> 
> I want to know how to use more than one gem version in the same ruby  
> application?  
> Is this feasible, if yes thn how?
> 
> Any pointer will be helpful to me.  
> Thanks in advance.

---

<div class="post-metadata">

**Author:** ![darshana](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/53a042/32.png) [@darshana](https://www.ruby-forum.com/u/darshana)\
**Post date:** [November 9, 2009, 3:58pm UTC](https://www.ruby-forum.com/t/how-to-use-more-than-one-gem-version-in-the-same-application/178663/3 "2009-11-09T15:58:28Z")

</div>

Darshana G. wrote:

> require ‘rubygems’  
> gem ‘hpricot’, ‘= 0.6’  
> try with correct syntax in environment.rb:

config.gem “hpricot”, :version =\> ‘0.6’, :source =\>  
“[http://code.whytheluckystiff.net](http://code.whytheluckystiff.net)”
