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

Discussion in 'Ruby' started by anne001, Jun 27, 2006.

  1. anne001

    anne001 Guest

    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?
    anne001, Jun 27, 2006
    #1
    1. Advertising

  2. anne001

    anne001 Guest

    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
    anne001, Jun 27, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. inhahe
    Replies:
    3
    Views:
    2,346
    Diez B. Roggisch
    Jan 28, 2005
  2. James Adam
    Replies:
    15
    Views:
    257
  3. DocPneumo
    Replies:
    4
    Views:
    223
    DocPneumo
    Jan 17, 2007
  4. Zane
    Replies:
    6
    Views:
    162
    Nicolas Despr├Ęs
    Feb 5, 2007
  5. Replies:
    4
    Views:
    169
Loading...

Share This Page