# Ruby's include path

**URL:** <https://www.ruby-forum.com/t/rubys-include-path/72123>\
**Category:** Ruby\
**Created:** [October 14, 2006, 3:34pm UTC](https://www.ruby-forum.com/t/rubys-include-path/72123 "2006-10-14T15:34:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bizzz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bizzz](https://www.ruby-forum.com/u/bizzz)\
**Post date:** [October 14, 2006, 3:34pm UTC](https://www.ruby-forum.com/t/rubys-include-path/72123/1 "2006-10-14T15:34:23Z")

</div>

Greetings,

I’m searching for something equivilent to Perl’s “use lib”.  
I can see that there is a -I parameter to ruby itself, but  
that seems clumsy when there are many paths to be added to  
the include path (is that what ruby even calls it?).

Thanks a bunch.

Andy

---

<div class="post-metadata">

**Author:** ![bizzz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bizzz](https://www.ruby-forum.com/u/bizzz)\
**Post date:** [October 14, 2006, 3:40pm UTC](https://www.ruby-forum.com/t/rubys-include-path/72123/2 "2006-10-14T15:40:23Z")

</div>

Hi –

On Sat, 14 Oct 2006, Andrew L. wrote:

> Greetings,
> 
> I’m searching for something equivilent to Perl’s “use lib”. I can see that  
> there is a -I parameter to ruby itself, but that seems clumsy when there are  
> many paths to be added to the include path (is that what ruby even calls  
> it?).

It’s called the load path, and it’s stored in the global $: variable,  
which is an array to which you can add:

$:.push("/whatever")

If you don’t like $: you can also address it as $LOAD\_PATH.

David

---

<div class="post-metadata">

**Author:** ![bizzz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bizzz](https://www.ruby-forum.com/u/bizzz)\
**Post date:** [October 14, 2006, 3:44pm UTC](https://www.ruby-forum.com/t/rubys-include-path/72123/3 "2006-10-14T15:44:23Z")

</div>

Outstanding, thanks!

Andy
