Iain Barnett wrote:
> On 3 Sep 2010, at 09:14, Brian Candler wrote:
> 
>> 
>> $LOAD_PATH.unshift ENV['GEM_HOME'] unless $LOAD_PATH.include? 
>> ENV['GEM_HOME']
> 
> Is there a way I can get this to run every time anything goes through 
> ruby, not just things I've written?

Well, there's

export RUBYOPT=-I/Users/iainuser/.gems
or
export RUBYOPT=-rmyfrig

(and then put your code in myfrig.rb somewhere which is always in 
$LOAD_PATH,
like 
/Library/Frameworks/Ruby.framework/Versions/1.9.2-p0/lib/ruby/site_ruby/1.9.1 
)

As long as RUBYOPT propagates of course.

For a more fundamental question, why do you want /Users/iainuser/.gems 
in your $LOAD_PATH anyway? Surely you want the lib dirs of the 
individual gems, and you wouldn't/shouldn't put ruby files at the top 
level?

B.

-- 
Posted via http://www.ruby-forum.com/.