[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

conflict between soap4r gem and stdlib

Joel VanderWerf

6/6/2008 4:24:00 AM


I installed a newer version of soap4r as a gem, but, when I require
soap, the old version (which came with ruby) is the one that is loaded.

$ ruby -r soap/soap -e 'p SOAP::VERSION'
"1.5.5"
$ grep VERSION
/usr/local/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/soap/soap.rb
VERSION = Version = '1.5.8'
$ ruby -v
ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-linux]


I can hack around this easily enough (install from a tar, maybe), but
why isn't the gem found first?

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

1 Answer

Eric Hodel

6/6/2008 5:40:00 AM

0

On Jun 5, 2008, at 21:24 PM, Joel VanderWerf wrote:
> I installed a newer version of soap4r as a gem, but, when I require
> soap, the old version (which came with ruby) is the one that is
> loaded.
>
> $ ruby -r soap/soap -e 'p SOAP::VERSION'
> "1.5.5"
> $ grep VERSION /usr/local/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/
> soap/soap.rb
> VERSION = Version = '1.5.8'
> $ ruby -v
> ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-linux]
>
> I can hack around this easily enough (install from a tar, maybe),
> but why isn't the gem found first?

RubyGems will only search for a file in a gem when it isn't in
$LOAD_PATH. Use gem 'soap4r' to put the gem in $LOAD_PATH before the
stdlib version before you require anything from soap4r. (I believe
this is included in the soap4r documentation.)