# How to override RUBYLIB for soap4r on shared host?

**URL:** <https://www.ruby-forum.com/t/how-to-override-rubylib-for-soap4r-on-shared-host/65611>\
**Category:** Ruby\
**Created:** [August 19, 2006, 7:53pm UTC](https://www.ruby-forum.com/t/how-to-override-rubylib-for-soap4r-on-shared-host/65611 "2006-08-19T19:53:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 19, 2006, 7:53pm UTC](https://www.ruby-forum.com/t/how-to-override-rubylib-for-soap4r-on-shared-host/65611/1 "2006-08-19T19:53:23Z")

</div>

Group,

I need to override a default Ruby library for Rails, and I’m having  
some troubles. I’m trying to run a program that consumes a PayPal web  
service using soap4r. Soap4r’s last point release (1.5.5) has a bug  
that PayPal trips over, but there is an incremental build since then  
that fixes it. I installed the incremental build on my local box and  
everything works, but when I put the code on the shared server I keep  
getting an error:  
undefined method `add\_document\_operation’ for  
#PayPalAPIAAInterface:0x4096b798

This indicates I need to upgrade soap4r.

If soap4r were a gem I could install it in ~/.gems or do freeze\_gems,  
but it’s not. I have hacked install.rb to install to ~/myruby , but I  
can’t figure out how to get ruby to look there first.

I’ve tried setting RUBYLIB in the .bashrc and .profile. This works  
for irb, but not for fcgi.

I have also added this line to my environment.rb and confirmed that it  
adds all the directories to the beginning of $: (and that it is  
spelled right)  
Dir.glob("/home/fidbaadmin/myruby/\*\*"){ |dir| $:[0,0] = dir}

However, this did not have the desired effect in irb OR fcgi OR when I  
finally just added it at the beginning of the script

How can I get ruby to look at these new files first? Any hints or  
clues would be greatly appreciated.

Thanks,  
Joe
