1 Jun 2012 12:01
Re: Ruby library path
Lars Haugseth <ruby-talk <at> larshaugseth.com>
2012-06-01 10:01:00 GMT
2012-06-01 10:01:00 GMT
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? The array of paths being searched for files are stored in the $: variable. To see the current array of paths, simply do: puts $: You can also append other paths to the array by putting this at the top of your Ruby script/application: $: << '/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: export RUBYLIB=/path/to/my/ruby-files -- -- Lars Haugseth
RSS Feed