# Ruby library path

**URL:** <https://rubytalk.org/t/ruby-library-path/65572>\
**Category:** ruby-talk\
**Created:** [1 June 2012 08:53 UTC](https://rubytalk.org/t/ruby-library-path/65572 "2012-06-01T08:53:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![7stud2](https://avatars.discourse-cdn.com/v4/letter/7/9de053/32.png) [@7stud2](https://rubytalk.org/u/7stud2)\
**Post date:** [1 June 2012 08:53 UTC](https://rubytalk.org/t/ruby-library-path/65572/1 "2012-06-01T08:53:56Z")

</div>

Hi,

I'm new at ruby, actually i just want to run puppet under aix in  
specified path.

The problem is: i cant set the path of my embedded ruby library. I tried  
to run the script with -I/opt/puppet-ruby/lib/ruby but it keeps saying  
that he cant load my .rb ...

Btw, from a ruby script how can i know the path of the used ruby  
library?

Kind Regards,

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Lars\_Haugseth1](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@Lars\_Haugseth1](https://rubytalk.org/u/Lars_Haugseth1)\
**Post date:** [1 June 2012 10:01 UTC](https://rubytalk.org/t/ruby-library-path/65572/2 "2012-06-01T10:01:00Z")

</div>

The array of paths being searched for files are stored in the $: variable. To see the current array of paths, simply do:

&nbsp;&nbsp;&nbsp;puts $:

You can also append other paths to the array by putting this at the top of your Ruby script/application:

&nbsp;&nbsp;&nbsp;$: \<\< '/path/to/my/ruby-files'

Alternatively you can also set the RUBYLIB environment variable. If you are using bash, for example, you can add this to your .bashrc file:

&nbsp;&nbsp;&nbsp;export RUBYLIB=/path/to/my/ruby-files

> **···**
>
> On 06/01/2012 10:53 AM, Christophe D. wrote:
> 
> > Hi,
> > 
> > I'm new at ruby, actually i just want to run puppet under aix in  
> > specified path.
> > 
> > The problem is: i cant set the path of my embedded ruby library. I tried  
> > to run the script with -I/opt/puppet-ruby/lib/ruby but it keeps saying  
> > that he cant load my .rb ...
> > 
> > Btw, from a ruby script how can i know the path of the used ruby  
> > library?
> 
> --  
> Lars Haugseth
