# Conflict between soap4r gem and stdlib

**URL:** <https://www.ruby-forum.com/t/conflict-between-soap4r-gem-and-stdlib/139704>\
**Category:** Ruby\
**Created:** [June 6, 2008, 6:28am UTC](https://www.ruby-forum.com/t/conflict-between-soap4r-gem-and-stdlib/139704 "2008-06-06T06:28:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joel\_VanderWerf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@Joel\_VanderWerf](https://www.ruby-forum.com/u/Joel_VanderWerf)\
**Post date:** [June 6, 2008, 6:28am UTC](https://www.ruby-forum.com/t/conflict-between-soap4r-gem-and-stdlib/139704/1 "2008-06-06T06:28:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Joel\_VanderWerf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@Joel\_VanderWerf](https://www.ruby-forum.com/u/Joel_VanderWerf)\
**Post date:** [June 6, 2008, 7:41am UTC](https://www.ruby-forum.com/t/conflict-between-soap4r-gem-and-stdlib/139704/2 "2008-06-06T07:41:12Z")

</div>

On Jun 5, 2008, at 21:24 PM, Joel VanderWerf wrote:

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