I’m trying to debug why my Ruby installation cannot find gems even
though we’ve followed what I think is a standard install.
In this case I’m trying to use micro-optparse and the require fails as
follows:
internal:lib/rubygems/custom_require:29:in require': no such file to load -- micro-optparse (LoadError) from <internal:lib/rubygems/custom_require>:29:inrequire’
from /home/sjalloq/bin/checkout:3:in `’
The gem was installed using ‘gem install …’ and I can list the gem:
$ gem list mic
*** LOCAL GEMS ***
micro-optparse (1.1.5)
If I set RUBYLIB to point to the gem installation then it loads but I
thought RUBYLIB was only needed for non-standard installs.
Is my understanding of installing gems correct and if so how do I debug
this further?
Do you have more than one ruby installation? I’ve got three (the system
1.9, the system 1.8, and my custom 1.9 install which is more recent).
Each install has it’s own copy of the gem program, and if I install a
gem with one in one version, the other versions have no idea that it’s
there.
Try:
which gem (using the exact same form that you used for the gem install)
and also:
which ruby (again, using the same form that you used to attempt
execution)
One of my installs is in /usr/local/bin/gem and /usr/local/bin/ruby,
another is in /usr/bin/gem1.9.1 and /usr/bin/ruby1.9.1,
the third is /usr/bin/ruby1.8 (gem isn’t installed for that one),