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:
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?
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?
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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.