Unpacked wrong version of gem, can't get back

Hey all

I got myself into a bit of a corner. I unpacked hpricot 0.8.2 into my vendor/gems folder then realised that i needed to unpack 0.8.1 instead. No problem, i thought, i'll just delete that folder out of gems, change the config.gem specification in environment.rb, and do it again. But now i get this error whenever i try to do anything with rake:

rake aborted! can't activate , already activated hpricot-0.8.2

I tried commenting out the line in environment.rb, which is

  config.gem "hpricot", :version => '0.8.1'

and doing

  rake gems:refresh_specs

This worked insofar as i was able to run rake without generating the error, but then when i uncomment the line, and try to unpack hpricot 0.8.1 then i get the error again.

Can anyone set me straight on this? Presumably somewhere other than vendor/gems 'knows' which gems are unpacked? Where is this info held?

Grateful for any advice - max

I managed to solve this by uninstalling version 0.8.2 of the hpricot gem. Which has confused me even more ... does my gems folder know what's going on in my rails app??? buh?

No, but rubygems "knows" that you want the highest available version when it encounters:

require 'hpricot'

You might have been requiring it somewhere earlier than Rails processed the config.gem that limited (specified) the version that you wanted.

-Rob

Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com

Rob Biedenharn wrote:

You might have been requiring it somewhere earlier than Rails processed the config.gem that limited (specified) the version that you wanted.

ah - in one of the other frozen gems or plugins you mean? I did a search of my application and the only reference i could find to hpricot was the line in my config/environment.rb:

config.gem "hpricot", :version => '0.8.1'

As it happens i still didn't fix it as, after uninstalling 0.8.2, i was able to unpack 0.8.1 into vendor/gems, but now i can't start mongrel or rake: i get this error:

The following gems have native components that need to be built   hpricot = 0.8.1

You're running:   ruby 1.8.6.111 at /usr/bin/ruby1.8   rubygems 1.3.5 at , /home/max/work/akrotoski_container/akrotoski/thoth, /home/max/.gem/ruby/1.8, /var/lib/gems/1.8

Run `rake gems:build` to build the unbuilt gems.

And of course, i can't do `rake gems:build` to build the unbuilt gems, because rake blows up with this error on starting!

I think i'm missing some fundamental knowledge about what is actually going on here.

Hi Rob - my first statement in that last post was actually a lie - haml (which i have in my plugins) requires hpricot, that must be the source of the first problem. I'd still like to know why it's complaining about me needing to build the gem though.