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

A

anne001

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?
 
A

anne001

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top