# Running Ruby code from a ZIP file?

**URL:** <https://www.ruby-forum.com/t/running-ruby-code-from-a-zip-file/115827>\
**Category:** Ruby\
**Created:** [September 28, 2007, 9:40pm UTC](https://www.ruby-forum.com/t/running-ruby-code-from-a-zip-file/115827 "2007-09-28T21:40:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubymarc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@rubymarc](https://www.ruby-forum.com/u/rubymarc)\
**Post date:** [September 28, 2007, 9:40pm UTC](https://www.ruby-forum.com/t/running-ruby-code-from-a-zip-file/115827/1 "2007-09-28T21:40:46Z")

</div>

I would like to run Ruby code from a ZIP file directly rather than  
extracting the contents of the ZIP into a folder and run from there.

I am familiar with the work done by this person:

[Tar2RubyScript - A Tool for Distributing Ruby Applications](http://www.erikveen.dds.nl/tar2rubyscript/index.html)  
[Distributing Ruby Applications - Theory and Practice of Building, Packing and Distributing Ruby Applications](http://www.erikveen.dds.nl/distributingrubyapplications/index.html)

However I find those techniques to be too limiting for my purposes.

Eventually I would want to be able to run Ruby code from an encrypted  
ZIP file as a Windows app - I don’t care about Linux or Unix as there  
are methods for getting Windows apps running from Linux or Unix  
natively (see also WINE).

The work of erikveen (see above) is interesting only because that  
approach does not attempt to make the Ruby source code encrypted only  
to misdirect the novice user from the actual location of the source  
code while the app is running however if the user happens to go poking  
around their temp folder while the app is running they get to see the  
Ruby source and this is unacceptable to me.

I would have thought someone might have done this already however so  
far I have not been able to find that someone.

BTW - Python allows this already in version 2.5.1 aside from the being  
encrypted part.

---

<div class="post-metadata">

**Author:** ![rubymarc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@rubymarc](https://www.ruby-forum.com/u/rubymarc)\
**Post date:** [September 28, 2007, 9:54pm UTC](https://www.ruby-forum.com/t/running-ruby-code-from-a-zip-file/115827/2 "2007-09-28T21:54:15Z")

</div>

Quoth Ruby M.:

> Eventually I would want to be able to run Ruby code from an encrypted  
> ZIP file as a Windows app - I don’t care about Linux or Unix as there  
> are methods for getting Windows apps running from Linux or Unix  
> natively (see also WINE).

That’s… not the best assumption.

> BTW - Python allows this already in version 2.5.1 aside from the being  
> encrypted part.

You obviously love Python. If python is the-right-tool-for-the-job use  
it. If  
ruby is, use it, and live with the consequences.

Regards,

---

<div class="post-metadata">

**Author:** ![rubymarc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@rubymarc](https://www.ruby-forum.com/u/rubymarc)\
**Post date:** [September 28, 2007, 10:01pm UTC](https://www.ruby-forum.com/t/running-ruby-code-from-a-zip-file/115827/3 "2007-09-28T22:01:22Z")

</div>

On 9/28/07, Konrad M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > However I find those techniques to be too limiting for my purposes.  
> > to misdirect the novice user from the actual location of the source  
> > You obviously love Python. If python is the-right-tool-for-the-job use it.  
> > If  
> > ruby is, use it, and live with the consequences.
> 
> ## Regards,
> 
> Konrad M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) [http://konrad.sobertillnoon.com/](http://konrad.sobertillnoon.com/)

With the name “Ruby M.”, you’d think there’d be less complaining  
about  
the Ruby language…

Anyway, this is dangerously close to double-posting. Please keep topics  
together and don’t start a new thread just because another one isn’t  
getting  
quite the answers you’re looking for.

Jason

---

<div class="post-metadata">

**Author:** ![rubymarc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@rubymarc](https://www.ruby-forum.com/u/rubymarc)\
**Post date:** [September 29, 2007, 3:59am UTC](https://www.ruby-forum.com/t/running-ruby-code-from-a-zip-file/115827/4 "2007-09-29T03:59:39Z")

</div>

Take a look at exerb…
