# Relocatable Ruby executable

**URL:** <https://www.ruby-forum.com/t/relocatable-ruby-executable/102459>\
**Category:** Ruby\
**Created:** [February 8, 2006, 5:33pm UTC](https://www.ruby-forum.com/t/relocatable-ruby-executable/102459 "2006-02-08T17:33:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asfand\_Yar\_Q](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/76d3ee/32.png) [@Asfand\_Yar\_Q](https://www.ruby-forum.com/u/Asfand_Yar_Q)\
**Post date:** [February 8, 2006, 5:33pm UTC](https://www.ruby-forum.com/t/relocatable-ruby-executable/102459/1 "2006-02-08T17:33:59Z")

</div>

Hi,

How can I create a relocatable Ruby executable? Meaning, that I can  
distribute a copy of it along with the modules I need with a binary app  
I am  
embedding Ruby into. I’m considering both actually programatically  
embedding  
Ruby into my app using libruby.a or whatever, as well as making my app  
an  
extension library run by the Ruby executable - if you could give details  
of  
both, I’d be grateful.

Thanks

---

<div class="post-metadata">

**Author:** ![Asfand\_Yar\_Q](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/76d3ee/32.png) [@Asfand\_Yar\_Q](https://www.ruby-forum.com/u/Asfand_Yar_Q)\
**Post date:** [February 8, 2006, 7:53pm UTC](https://www.ruby-forum.com/t/relocatable-ruby-executable/102459/2 "2006-02-08T19:53:48Z")

</div>

Asfand Yar Q. wrote:

> 

Are you aware of rubyscript2exe? It packages the interpreter + libraries  
you require + your main script file. I’ve been very happy with it.

[http://www.erikveen.dds.nl/rubyscript2exe/index.html](http://www.erikveen.dds.nl/rubyscript2exe/index.html)

This is for the ruby extension approach, but not the embedding approach.

---

<div class="post-metadata">

**Author:** ![Asfand\_Yar\_Q](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/76d3ee/32.png) [@Asfand\_Yar\_Q](https://www.ruby-forum.com/u/Asfand_Yar_Q)\
**Post date:** [February 8, 2006, 10:24pm UTC](https://www.ruby-forum.com/t/relocatable-ruby-executable/102459/3 "2006-02-08T22:24:07Z")

</div>

DÅ?a Streda 08 FebruÃ¡r 2006 17:33 Asfand Yar Q. napÃ­sal:

> Hi,
> 
> How can I create a relocatable Ruby executable? Meaning, that I can  
> distribute a copy of it along with the modules I need with a binary app I  
> am embedding Ruby into. I’m considering both actually programatically  
> embedding Ruby into my app using libruby.a or whatever, as well as making  
> my app an extension library run by the Ruby executable - if you could give  
> details of both, I’d be grateful.
> 
> Thanks

I -think- on Windows the ruby interpreter semiautomagically sets up the  
paths  
it needs relative to the path where ruby.exe that was run is located, so  
if  
you can go without the aesthetics and compactness of rubyscript2exe, you  
should be able to safely get away with distributing your ruby directory  
along  
in the application’s distribution somewhere.

David V.
