I totally messed up rubygems (deleted the sources gem) and now I can't install any gem anymore

Okay I had some troubles today and wanted to do a total reinstallation
of rubygems and all gems I had. So I removed rubygems with:
sudo apt-get remove --purge rubygems
and then I did the big mistake and deleted the whole gems folder:
sudo rm -rd /var/lib/gems/1.8/gems

Now I have a big problem. I reinstalled rubygems but when I wanna
install any gem I’m getting an error like this:
$: sudo gems install hpricot
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require’: no such file to load — sources (LoadError) from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:inrequire’
from /usr/lib/ruby/1.8/rubygems/remote_installer.rb:462:in
`sources’
[…]

I now found out the problem is I need a sources gem? I found out that I
still have this gem in the gems/cache folder:
/var/lib/gems/1.8/cache/sources-0.0.1.gem

But how to install? If I do
sudo gem install -local /var/lib/gems/1.8/cache/sources-0.0.1.gem

I also get the same error like above:
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require’: no such file to load — sources (LoadError)

I have no idea how to fix this now? Can someone help me with this?

greets

If you threw out the gems dir, but not the gems cache, your cache is
probably inaccurate. I’d say just throw out the cache and try again.

On 11/1/07, kazaam [email protected] wrote:

      [..]

I have no idea how to fix this now? Can someone help me with this?

greets

kazaam [email protected]


Giles B.

Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com/