# Howto use rubyscript2exe to package some external applicatio

**URL:** <https://www.ruby-forum.com/t/howto-use-rubyscript2exe-to-package-some-external-applicatio/66321>\
**Category:** Ruby\
**Created:** [February 12, 2006, 11:53pm UTC](https://www.ruby-forum.com/t/howto-use-rubyscript2exe-to-package-some-external-applicatio/66321 "2006-02-12T23:53:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 12, 2006, 11:53pm UTC](https://www.ruby-forum.com/t/howto-use-rubyscript2exe-to-package-some-external-applicatio/66321/1 "2006-02-12T23:53:49Z")

</div>

Dear all,

I would like to distribute a Ruby application that calls  
an external application.  
So far, I give the potential user the opportunity  
to enter or change some Gnuplot code, which is  
sent to Gnuplot via Open3 and produces some plot.  
Now, I would like to avoid asking the user to make  
sure he has Gnuplot installed.

1.) How can I ensure that everything that I need from Gnuplot  
is included in my application ? Is this done automatically  
by rubyscript2exe ?  
2.) Can the Open3 syntax be used even if Gnuplot is not  
installed on the system the new distributed file is run on -  
will some file from the package created by rubyscript2exe  
(question 1) be substituted for the missing installation of Gnuplot ?

Thank you very much,

Best regards,

Axel

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 13, 2006, 12:04am UTC](https://www.ruby-forum.com/t/howto-use-rubyscript2exe-to-package-some-external-applicatio/66321/2 "2006-02-13T00:04:04Z")

</div>

DÅ?a NedeÄ¾a 12 FebruÃ¡r 2006 23:53 removed\_email\_address@domain.invalid napÃ­sal:

> 1.) How can I ensure that everything that I need from Gnuplot
> 
> Axel

I have very, very strong doubts rubyscript2exe will detect and pack  
external  
applications. My wild guess is rubyscript2exe sort of dumps the state of  
the  
interpreter at the end of the execution of your script, with all  
dependencies  
loaded in memory.

Since Gnuplot is an external application not residing in the memory  
space of  
the interpreter, you’re probably stuck with making sure Gnuplot is  
installed.  
You could also make an installer for your application and distribute  
Gnuplot  
with it.

Disclaimer: I might be completely wrong.

David V.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 13, 2006, 1:09am UTC](https://www.ruby-forum.com/t/howto-use-rubyscript2exe-to-package-some-external-applicatio/66321/3 "2006-02-13T01:09:09Z")

</div>

removed\_email\_address@domain.invalid wrote:

> I would like to distribute a Ruby application that calls  
> an external application.

> 1.) How can I ensure that everything that I need from Gnuplot  
> is included in my application ? Is this done automatically  
> by rubyscript2exe ?

No, it’s not done automatically. You can tell rubyscript2exe to include  
an external executable in the package by setting the constant  
RUBYSCRIPT2EXE\_BIN at “compile”  
time

RUBYSCRIPT2EXE\_BIN = [‘myapp.exe’]

When the “compiled” executable is run, PATH is altered so that the  
bundled executable will be available.

This works well for executables that are single self-contained files, as  
well as for  
dlls (using RUBYSCRIPT2EXE\_DLLS), but probably not so well for programs  
that expect lots of support files to be installed alongside.

hth  
alex

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 13, 2006, 9:53am UTC](https://www.ruby-forum.com/t/howto-use-rubyscript2exe-to-package-some-external-applicatio/66321/4 "2006-02-13T09:53:39Z")

</div>

> I would like to distribute a Ruby application that calls an  
> external application. So far, I give the potential user the  
> opportunity to enter or change some Gnuplot code, which is  
> sent to Gnuplot via Open3 and produces some plot. Now, I  
> would like to avoid asking the user to make sure he has  
> Gnuplot installed.
> 
> 1.) How can I ensure that everything that I need from Gnuplot  
> is included in my application ? Is this done automatically by  
> rubyscript2exe ?

No, it’s not.

But, according to the RubyScript2Exe documentation, you can do  
this: Put everything you need (your application and other  
applications) in one directory tree, build an RBA from this  
directory with Tar2RubyScript [1] and “compile” this RBA with  
RubyScript2Exe [2].

All steps, including the rationale of both projects, are  
described in [3].

gegroet,  
Erik V. - [http://www.erikveen.dds.nl/](http://www.erikveen.dds.nl/)

[1] [http://www.erikveen.dds.nl/tar2rubyscript/index.html](http://www.erikveen.dds.nl/tar2rubyscript/index.html)  
[2] [http://www.erikveen.dds.nl/rubyscript2exe/index.html](http://www.erikveen.dds.nl/rubyscript2exe/index.html)  
[3] [Distributing Ruby Applications - Theory and Practice of Building, Packing and Distributing Ruby Applications](http://www.erikveen.dds.nl/distributingrubyapplications/index.html)
