Phil Tomson wrote:

>True, I could do those things, but I'm wondering how they managed to make 
>$LOAD_PATH relative on Windows?
>  
>
Because Ruby was coded to work that way.  Why it wasn't made to do it 
under *nix, I have no idea.  I think it's a critical requirement, 
otherwise having private copies of Ruby installs is impossible.  It will 
always go to /usr/lib/ruby, etc. no matter where Ruby is run from.  
After my message about this subject was ignored (Installation/Config 
question), I decided to just write it myself and patch Ruby.

Here's what I did.
After ./configure - the bottom of config.h must be changed to be rooted 
off of /lib (the rest stays the same)
#define LOAD_RELATIVE 1 must also be added.

(here was what mine looked like)
#define RUBY_LIB "/lib/ruby/1.8"
#define RUBY_SITE_LIB "/lib/ruby/site_ruby"
#define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/1.8"
#define RUBY_PLATFORM "i686-linux"
#define RUBY_ARCHLIB "/lib/ruby/1.8/i686-linux"
#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/1.8/i686-linux"
#define LOAD_RELATIVE 1

in ruby.c in the ruby_init_loadpath() method I added a #else section 
after the #elif defined(_EMX) which was withih the #if defined 
LOAD_RELATIVE section.
It looked something like this:
#elif defined(__EMX__)
    _execname(libpath, FILENAME_MAX);
#else
    /* pmb 03/01/2004 */
    buf = malloc(size);
    while ((rv = readlink("/proc/self/exe", buf, size)) == size) {
        size *= 2;
        buf = realloc(buf, size);
    }
    if (rv < 0 || rv >= FILENAME_MAX) {
        free(buf);
        fprintf(stderr, "Unable to get path to self through 
/proc/self/exe");
        exit(1);
    }
    strncpy(libpath, buf, rv);
    libpath[rv] = '\0';
    free(buf);
#endif


>  
>