# Gems gone after upgrading RubyGems

**URL:** <https://www.ruby-forum.com/t/gems-gone-after-upgrading-rubygems/124748>\
**Category:** Ruby\
**Created:** [January 2, 2008, 7:16am UTC](https://www.ruby-forum.com/t/gems-gone-after-upgrading-rubygems/124748 "2008-01-02T07:16:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lobo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/76d3ee/32.png) [@lobo](https://www.ruby-forum.com/u/lobo)\
**Post date:** [January 2, 2008, 7:16am UTC](https://www.ruby-forum.com/t/gems-gone-after-upgrading-rubygems/124748/1 "2008-01-02T07:16:35Z")

</div>

Hello guys,

I’m new to Ruby and Linux, I was happily doing some examples and  
exploring this wonderful language, when I decided to upgrade to RubyGems  
1.0.1.

After that (and I think it was after that, not really sure), all the  
gems I had installed where gone.

Issuing this command showed an empty list:  
“gem list” or “sudo gem list”

But I was sure I had rails, mongrel, sqlite3, rake and other gems  
installed. So I did a "find / -name “mongrel\*.\*” and found them in:  
/var/lib/gems/1.8/gems

After typing “gem env” I got this:  
RubyGems Environment:

- RUBYGEMS VERSION: 1.0.1 (1.0.1)
- RUBY VERSION: 1.8.6 (2007-06-07 patchlevel 36) [i486-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- RUBYGEMS PLATFORMS:
  - ruby
  - x86-linux

- GEM PATHS:
  - /usr/lib/ruby/gems/1.8

- GEM CONFIGURATION:
  - :update\_sources =\> true
  - :verbose =\> true
  - :benchmark =\> false
  - :backtrace =\> false
  - :bulk\_threshold =\> 1000

- REMOTE SOURCES:
  - [http://gems.rubyforge.org](http://gems.rubyforge.org)

So how do I tell RubyGems to look in the old directories? and why did  
the directories change? do you think something else could be broken with  
my installation? how can I prevent this from happening again?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![lobo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/76d3ee/32.png) [@lobo](https://www.ruby-forum.com/u/lobo)\
**Post date:** [January 2, 2008, 12:54pm UTC](https://www.ruby-forum.com/t/gems-gone-after-upgrading-rubygems/124748/2 "2008-01-02T12:54:46Z")

</div>

Well I couldn’t find where to change those default settings, so I  
resorted to modifying my “.bashrc” file ☹

I added this lines to it:  
GEM\_HOME=/var/lib/gems/1.8  
export GEM\_HOME

GEM\_PATH=/var/lib/gems/1.8  
export GEM\_PATH

After I added those lines I could see my old gem list with: “gem list”

But now I have a different problem, I installed the JSON gem with: “gem  
install json”, and all went ok. I can even see the gem listed in my  
local list:  
\*\*\* LOCAL GEMS \*\*\*  
json (1.1.2)

But if I go into “irb”, and type: “require ‘json’”, it would complain  
with:  
irb(main):002:0\> require ‘json’  
LoadError: no such file to load – json  
from (irb):2:in `require’  
from (irb):2

What else do I need to change, so irb will load my newly installed gems?

---

<div class="post-metadata">

**Author:** ![lobo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/76d3ee/32.png) [@lobo](https://www.ruby-forum.com/u/lobo)\
**Post date:** [January 5, 2008, 10:00am UTC](https://www.ruby-forum.com/t/gems-gone-after-upgrading-rubygems/124748/3 "2008-01-05T10:00:56Z")

</div>

On Jan 1, 2008, at 22:16 PM, Lobo tuerto Cazador wrote:

> But I was sure I had rails, mongrel, sqlite3, rake and other gems  
> installed. So I did a "find / -name “mongrel\*.\*” and found them in:  
> /var/lib/gems/1.8/gems

If you installed RubyGems first using an apt package (apt’s RubyGems  
installs gems into /var/lib), then upgraded RubyGems with gem update –  
system, these kinds of things may happen. There is a warning note in  
the release announcement about this.
