From: Guillaume Marcais Date: 2005-12-28T07:38:50+09:00 Subject: Re: gem and ruby extension On Wed, 2005-12-28 at 06:33 +0900, Jim Weirich wrote: > Guillaume Marcais wrote: > > Duh! Why can't it load rulog.so in the first case? The platform is ruby > > 1.8.2 (2004-12-25) [i586-linux-gnu]. > > Ruby is able to find libraries installed via RubyGems only after the > rubygem library is loaded. You can accomplish in several ways, > including setting an environment variable (RUBYOPT=rubygems), including > -rubygems on your ruby command line, or even putting a 'require > "rubygems"' in your source code. See > http://docs.rubygems.org/read/chapter/3#page70 for details. Thanks for you quick answer. But I forgot to mention that I already have the RUBYOPT variable set: [gus@comp ruby-1.8.2]$ echo $RUBYOPT -rrubygems [gus@comp ruby-1.8.2]$ grep RUBY ~/.bashrc RUBYOPT="-rrubygems" export RUBYOPT What strikes me as odd in this case is that it gives the right path of the library to load (somewhere in /usr/lib/ruby/gems) but fails to load it. If the path is added to $: (in the second example), then it loads properly. Guillaume. > -- > -- Jim Weirich >