17 Aug 2012 15:37
Re: Debugging failed Ruby Gem require
James Harrison <jam <at> jamandbees.net>
2012-08-17 13:37:10 GMT
2012-08-17 13:37:10 GMT
On Fri, Aug 17, 2012 at 6:34 AM, Shareef J. <lists <at> ruby-forum.com> wrote:
Hi there,
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:in `require'
from /home/sjalloq/bin/checkout:3:in `<main>'
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?
$ gem --version
1.3.7
$ ruby --version
ruby 1.9.2p136 (2010-12-25) [x86_64-linux]
Thanks, Shareef.
--
Posted via http://www.ruby-forum.com/.
It's a little hard to say, but:
1. That's a damn old version of rubygems. Try executing gem update to update to the latest sources and whatnot.
2. If gem can find a package, and ruby cannot find a package, then gem is probably not using the version of ruby you think it is.
3. Check the paths that gem is searching through (gem env) and the paths that ruby is searching through (ruby -e "puts $:") and see what's different.
RSS Feed