# $loadpath

**URL:** <https://www.ruby-forum.com/t/loadpath/135642>\
**Category:** Ruby\
**Created:** [April 23, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/loadpath/135642 "2008-04-23T20:41:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chinnakaruppan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c4cdca/32.png) [@chinnakaruppan](https://www.ruby-forum.com/u/chinnakaruppan)\
**Post date:** [April 23, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/loadpath/135642/1 "2008-04-23T20:41:31Z")

</div>

Hi,  
I am using irb and when ever i open IRB session I have to update my  
$LOADPATH with my ruby program directory. $LOADPATH \<\< “c:/rb” .How can  
I avoid this.becauze I find some paths already set.So I was checking the  
environment variables in windows.I didn’t find any loadpath…  
Any suggestion  
THnks  
Chinna

---

<div class="post-metadata">

**Author:** ![chinnakaruppan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c4cdca/32.png) [@chinnakaruppan](https://www.ruby-forum.com/u/chinnakaruppan)\
**Post date:** [April 23, 2008, 9:01pm UTC](https://www.ruby-forum.com/t/loadpath/135642/2 "2008-04-23T21:01:24Z")

</div>

Chinna K. wrote:

> Hi,  
> I am using irb and when ever i open IRB session I have to update my  
> $LOADPATH with my ruby program directory. $LOADPATH \<\< “c:/rb” .How can  
> I avoid this.becauze I find some paths already set.So I was checking the  
> environment variables in windows.I didn’t find any loadpath…  
> Any suggestion  
> THnks  
> Chinna

The env var is RUBYLIB, the global is $LOAD\_PATH or $:.

This is on linux but should illustrate the relationship:

$ RUBYLIB=“foo” ruby -e ‘p $LOAD\_PATH’  
[“foo”, “/usr/local/lib/ruby/site\_ruby/1.8”,  
“/usr/local/lib/ruby/site\_ruby/1.8/i686-linux”,  
“/usr/local/lib/ruby/site\_ruby”, “/usr/local/lib/ruby/1.8”,  
“/usr/local/lib/ruby/1.8/i686-linux”, “.”]

---

<div class="post-metadata">

**Author:** ![chinnakaruppan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c4cdca/32.png) [@chinnakaruppan](https://www.ruby-forum.com/u/chinnakaruppan)\
**Post date:** [April 23, 2008, 9:05pm UTC](https://www.ruby-forum.com/t/loadpath/135642/3 "2008-04-23T21:05:15Z")

</div>

Works .Saved some time for me! Thank you  
THnks

Joel VanderWerf wrote:

> Chinna K. wrote:
> 
> > Hi,  
> > I am using irb and when ever i open IRB session I have to update my  
> > $LOADPATH with my ruby program directory. $LOADPATH \<\< “c:/rb” .How can  
> > I avoid this.becauze I find some paths already set.So I was checking the  
> > environment variables in windows.I didn’t find any loadpath…  
> > Any suggestion  
> > THnks  
> > Chinna
> 
> The env var is RUBYLIB, the global is $LOAD\_PATH or $:.
> 
> This is on linux but should illustrate the relationship:
> 
> $ RUBYLIB=“foo” ruby -e ‘p $LOAD\_PATH’  
> [“foo”, “/usr/local/lib/ruby/site\_ruby/1.8”,  
> “/usr/local/lib/ruby/site\_ruby/1.8/i686-linux”,  
> “/usr/local/lib/ruby/site\_ruby”, “/usr/local/lib/ruby/1.8”,  
> “/usr/local/lib/ruby/1.8/i686-linux”, “.”]
