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

**URL:** <https://www.ruby-forum.com/t/i-totally-messed-up-rubygems-deleted-the-sources-gem-and-now-i-cant-install-any-gem-anymore/118967>\
**Category:** Ruby\
**Created:** [November 1, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/i-totally-messed-up-rubygems-deleted-the-sources-gem-and-now-i-cant-install-any-gem-anymore/118967 "2007-11-01T19:45:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kazaam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b4bc9f/32.png) [@kazaam](https://www.ruby-forum.com/u/kazaam)\
**Post date:** [November 1, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/i-totally-messed-up-rubygems-deleted-the-sources-gem-and-now-i-cant-install-any-gem-anymore/118967/1 "2007-11-01T19:45:49Z")

</div>

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:in`requireâ€™  
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

---

<div class="post-metadata">

**Author:** ![kazaam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b4bc9f/32.png) [@kazaam](https://www.ruby-forum.com/u/kazaam)\
**Post date:** [November 1, 2007, 8:33pm UTC](https://www.ruby-forum.com/t/i-totally-messed-up-rubygems-deleted-the-sources-gem-and-now-i-cant-install-any-gem-anymore/118967/2 "2007-11-01T20:33:58Z")

</div>

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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> [..]
> 
> ```
> 
> I have no idea how to fix this now? Can someone help me with this?
> 
> ## greets
> 
> kazaam [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

–  
Giles B.

Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
Tumblelog: [http://giles.tumblr.com/](http://giles.tumblr.com/)
