[OOT] Gem usage on Fedora

This may be s stupid mistake on my part, but I have spent a good hour on it.

Just compiled ruby on Fedora 8, then installed rubygems and then installed a
few gems -

$ gem list

*** LOCAL GEMS ***

facets (1.8.54)
flexmock (0.8.0)
log4r (1.0.5)
rake (0.8.1)

Now in trying to use them I did -

$ export RUBYOPT='-w -rubygems'
and then
$ irb
irb(main):001:0> $:
=> ["/usr/local/lib/ruby/site_ruby/1.8",
"/usr/local/lib/ruby/site_ruby/1.8/x86_64-linux",
"/usr/local/lib/ruby/site_ruby", "/usr/local/lib/ruby/1.8",
"/usr/local/lib/ruby/1.8/x86_64-linux", "."]
irb(main):002:0>
irb(main):003:0*
irb(main):004:0* require 'log4r'
LoadError: no such file to load -- log4r
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from (irb):4

The gems are installed properly -

$ gem which log4r
(checking gem log4r-1.0.5 for log4r)
/usr/local/lib/ruby/gems/1.8/gems/log4r-1.0.5/src/log4r.rb

What I may be missing?

Regards
Nasir

Hi,

I think it is -rrubygems, the -r for require and rubygems for the name
of the library.

Dan

···

On Fri, Mar 14, 2008 at 2:17 PM, Nasir Khan <rubylearner@gmail.com> wrote:

This may be s stupid mistake on my part, but I have spent a good hour on it.

Just compiled ruby on Fedora 8, then installed rubygems and then installed a
few gems -

$ gem list

*** LOCAL GEMS ***

facets (1.8.54)
flexmock (0.8.0)
log4r (1.0.5)
rake (0.8.1)

Now in trying to use them I did -

$ export RUBYOPT='-w -rubygems'
and then
$ irb
irb(main):001:0> $:
=> ["/usr/local/lib/ruby/site_ruby/1.8",
"/usr/local/lib/ruby/site_ruby/1.8/x86_64-linux",
"/usr/local/lib/ruby/site_ruby", "/usr/local/lib/ruby/1.8",
"/usr/local/lib/ruby/1.8/x86_64-linux", "."]
irb(main):002:0>
irb(main):003:0*
irb(main):004:0* require 'log4r'
LoadError: no such file to load -- log4r
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from (irb):4

The gems are installed properly -

$ gem which log4r
(checking gem log4r-1.0.5 for log4r)
/usr/local/lib/ruby/gems/1.8/gems/log4r-1.0.5/src/log4r.rb

What I may be missing?

Regards
Nasir

Daniel Finnie wrote:

I think it is -rrubygems, the -r for require and rubygems for the name
of the library.

Actually, RubyGems ships with a wrapper library called 'ubygems' (note
the missing 'r'), which enables this neat trick.

jwm