Gems gone after upgrading RubyGems

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:

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.

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

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?

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.