From: James French Date: 2011-09-22T23:49:43+09:00 Subject: Re: help with LOAD_PATH when building from source on Mac OSX Lion On 8 Sep 2011, at 14:11, Robert Klemme wrote: > On Thu, Sep 8, 2011 at 2:06 PM, James French > wrote: >> >> On 8 Sep 2011, at 12:23, Marc Heiler wrote: >> >>> Why not pass the --prefix to configure when compiling? >>> >>> ./configure --prefix=~/buildtools/ruby/1.9.2 >> >> Thanks, I wasn't sure how to do that. It required an absolute path but /Users/~/buildtools/ruby/1.9.2 > > You could also do > > ./configure "--prefix=${HOME}/buildtools/ruby/1.9.2" > > assuming your shell expands ~ to the home directory. > >> did the trick and it can now load standard library files. Still having issues with gems but I am unblocked for the moment so thanks! >> >> I must say I'm surprised ruby doesn't set up its default paths relative to the ruby executable to prevent hard coding of location - means that we have to maintain a company standard folder (there are other folders before build tools that I didn't mention). Not a huge deal though. > > Well, both approaches have pros and cons. If you create a symlink to > the ruby executable from another directory then relative paths won't > work. And since usually the installation is done once on a system and > not changed there is really no point in having relative paths. They > might also open security holes. All in all to me it seems the > approach taken is reasonable. > > Kind regards > > robert > > -- > remember.guy do |as, often| as.you_can - without end > http://blog.rubybestpractices.com/ > Updating thread with the solution: when building ruby from source specify --enable-load-relative when invoking configure. This makes the distro relocatable - default load paths are then correct wherever the distro is placed.