4.9.2009

Ruby gems 1.9 apt-gotten

On Ubuntu and Debian -boxes I keep having the same problem over and over again. Rubygems are installed by apt-get in 'non-usual' place, and once you have 'sudo gem install'-ed some gem someplace, it wont load with "require 'gemnamehere'" -- you end up with the fun error

LoadError: no such file to load -- narray

So, once again its been enough time, four months or so that I dont remember how I solved this the last time. I did find some old source where I simply required the gem lib directly ("/var/lib/gems/1.8........") but thats not very smart.

So, I am writing this for myself as a troubleshooter:

1. Assert 'sudo gem install blah'. Not as user.
2. See in irb if gem shows with '$:' command.
3. If in irb, and installing gems, restart it before trying to 'load' or 'require.

This time it was the 1 and 3. Silly me.