conflict between soap4r gem and stdlib

  • Thread starter Joel VanderWerf
  • Start date
J

Joel VanderWerf

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?
 
E

Eric Hodel

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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top