# Building ruby in a path independent fashion

**URL:** <https://www.ruby-forum.com/t/building-ruby-in-a-path-independent-fashion/91979>\
**Category:** Ruby\
**Created:** [April 13, 2007, 10:45pm UTC](https://www.ruby-forum.com/t/building-ruby-in-a-path-independent-fashion/91979 "2007-04-13T22:45:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MDMDMD](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/22d042/32.png) [@MDMDMD](https://www.ruby-forum.com/u/MDMDMD)\
**Post date:** [April 13, 2007, 10:45pm UTC](https://www.ruby-forum.com/t/building-ruby-in-a-path-independent-fashion/91979/1 "2007-04-13T22:45:23Z")

</div>

Hi,

I noticed that when I build and install ruby/gems, the path is hard  
coded in the scripts. This causes a problem when I build on say an AIX  
machine A and want to run the interpreter on AIX machine B. Is there  
any way for the interpreter to be built in a path independent fashion?

Thanks in advance.

Regards,  
-Manas

---

<div class="post-metadata">

**Author:** ![MDMDMD](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/22d042/32.png) [@MDMDMD](https://www.ruby-forum.com/u/MDMDMD)\
**Post date:** [April 14, 2007, 2:08pm UTC](https://www.ruby-forum.com/t/building-ruby-in-a-path-independent-fashion/91979/2 "2007-04-14T14:08:21Z")

</div>

On 4/13/07, MD [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> I noticed that when I build and install ruby/gems, the path is hard  
> coded in the scripts. This causes a problem when I build on say an AIX  
> machine A and want to run the interpreter on AIX machine B. Is there  
> any way for the interpreter to be built in a path independent fashion?

In general this is only possible with OS linker support (liko on OS  
X). The interpreter needs its dynamic libraries, and paths to these is  
traditionally hardcoded on unix-like OSes. If you place the  
interpreter in a different place linking usually breaks. But once you  
have interpreters on both systems you can look for extensions in  
various places. I am not sure about the gem loading but normal  
extensions can be loaded from anyplace you like.

Thanks

Michal
