[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

irb require ... where does irb look? what path?

anne001

6/27/2006 11:52:00 AM

if I go to
/usr/lib/ruby/site_ruby/1.8/universal-darwin8.0
where I have opengl.bungle
irb -r 'opengl'
works fine, no error message
if I am not in that directory, I get an error, no such file to load.

I physically copied all the 1.8.4 files into the 1.8.2 expected path.
but kept the $path
/private/opt/local/bin:/private/opt/local/lib:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/mysql/bin/
so programs should find the files in whatever location they look.

but apparently
/usr/lib/ruby/site_ruby/1.8/universal-darwin8.0
is not a place irb 1.8.4 looks for bundles.

how does require ... work. What are the locations it looks into?

1 Answer

anne001

6/27/2006 12:08:00 PM

0

oups, found the answer

Your require path is the current directory, the $RUBYLIB (on your ENV)

or ruby -e 'print $:' ,
anything inside this folders will be 'required' without specifying the

complete path name
so you can ...try it.
export RUBYLIB=/usr/local/lib/ruby/mylibs:$RUBYLIB