Moving Ruby installation causes it to not function. How to get around this?

ruby

Solution

Found that the solution is to use --enable-load-relative when running configure

So instead of:

./configure

Run:

./configure --enable-load-relative

Problem

I would like to compile Ruby from source, install it, then move the installation somewhere else. For example: ``` ruby-1.9.3-p125$ ./configure --prefix=/tmp/ruby-1.9.3-p125 ``` The problem is that it would seem the `--prefix` path is hardcoded in the Ruby binary. When I move `/tmp/ruby-1.9.3-p125` to say `/opt/ruby-1.9.3-p125`, the hardcoded paths are present in the installed binaries and scripts. After moving, I get an error: ``` <internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError) from <internal:gem_prelude>:1:in `<compiled>' ``` How can I get around this?

Original source