# Packaging source files on multiple OSs

**URL:** <https://www.ruby-forum.com/t/packaging-source-files-on-multiple-oss/182637>\
**Category:** Ruby\
**Created:** [January 31, 2010, 6:41pm UTC](https://www.ruby-forum.com/t/packaging-source-files-on-multiple-oss/182637 "2010-01-31T18:41:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![elricstorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/da6949/32.png) [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Post date:** [January 31, 2010, 6:41pm UTC](https://www.ruby-forum.com/t/packaging-source-files-on-multiple-oss/182637/1 "2010-01-31T18:41:15Z")

</div>

Can anyone direct me to an article or site that shows how to package  
applications built with Ruby? If I create a GUI application and want to  
package it for Mac, Linux, and Windows, I’d like to know what’s involved  
in the packaging process so that I can ensure I setup my build  
environment efficiently.

I also would like to ensure that people can use my applications but at  
the same time I would like to protect my code. On windows, normally I  
would use an obfuscator, or something similar, to protect my code.

The following applies to this scenario:

Users may or may not have ruby installed on their system

Any suggestions or advice would be greatly appreciated.

My thanks.

---

<div class="post-metadata">

**Author:** ![elricstorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/da6949/32.png) [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Post date:** [February 1, 2010, 12:26am UTC](https://www.ruby-forum.com/t/packaging-source-files-on-multiple-oss/182637/2 "2010-02-01T00:26:00Z")

</div>

Compiling a list of things I found so far:

Ocra (works fine but only packages for windows exe and also has some  
issues with xml.load with wx\_sugar and xrc source compile (bug reported  
tonight)).

Crate (this looks very promising but it doesn’t work on Ruby 1.9.  
Verified this on [isitruby19.com](http://isitruby19.com) and added my own report there as well.)  
According to the docs it appears it will provide packaging for windows,  
mac, and linux, which is what I’m after.

Other than these two, I’m not finding much luck.

---

<div class="post-metadata">

**Author:** ![elricstorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/da6949/32.png) [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Post date:** [February 1, 2010, 1:17am UTC](https://www.ruby-forum.com/t/packaging-source-files-on-multiple-oss/182637/3 "2010-02-01T01:17:47Z")

</div>

Alpha B. wrote:

> Compiling a list of things I found so far:
> 
> Ocra (works fine but only packages for windows exe and also has some  
> issues with xml.load with wx\_sugar and xrc source compile (bug reported  
> tonight)).
> 
> Crate (this looks very promising but it doesn’t work on Ruby 1.9.  
> Verified this on [isitruby19.com](http://isitruby19.com) and added my own report there as well.)  
> According to the docs it appears it will provide packaging for windows,  
> mac, and linux, which is what I’m after.
> 
> Other than these two, I’m not finding much luck.

Monkeybars uses Rawr and JRuby to do exactly what you’re talking about.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![elricstorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/da6949/32.png) [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Post date:** [February 1, 2010, 10:59pm UTC](https://www.ruby-forum.com/t/packaging-source-files-on-multiple-oss/182637/4 "2010-02-01T22:59:10Z")

</div>

Marnen Laibow-Koser wrote:

> Monkeybars uses Rawr and JRuby to do exactly what you’re talking about.

Thanks Marnen, I did try out monkeybars but I didn’t like the library.  
I have become very familiar with WxRuby now and have dug deep into the  
API. I’m going to stick with WxRuby and hopefully either crate comes up  
to speed, or I’ll use ocra for windows packaging (which now works for  
me) and come up with alternative packaging for other OS’s.

My last issue has to do with lack of obfuscation, which I only want to  
apply to my source code and not to the ruby libraries that are packaged  
with my code. I may have to create an obfuscator myself, but that’s a  
long and tedious process.

Thanks again.

---

<div class="post-metadata">

**Author:** ![elricstorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/da6949/32.png) [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Post date:** [February 1, 2010, 11:16pm UTC](https://www.ruby-forum.com/t/packaging-source-files-on-multiple-oss/182637/5 "2010-02-01T23:16:35Z")

</div>

On Monday 01 February 2010 03:59:12 pm Alpha B. wrote:

> Marnen Laibow-Koser wrote:
> 
> > Monkeybars uses Rawr and JRuby to do exactly what you’re talking about.
> 
> Thanks Marnen, I did try out monkeybars but I didn’t like the library.  
> [snip]  
> My last issue has to do with lack of obfuscation, which I only want to  
> apply to my source code and not to the ruby libraries that are packaged  
> with my code. I may have to create an obfuscator myself, but that’s a  
> long and tedious process.

First, realize it’s not going to work, whatever your rationale is. If  
you want  
to obfuscate it because there’s DRM involved, DRM is inherently flawed  
and  
will _never_ succeed. If you want to obfuscate it because you don’t want  
people “stealing” your code and re-using it for something else,  
copyright law  
is a much better way to deal with that.

But if you’re still determined to obfuscate your source, JRuby is likely  
going  
to be the best way to do that, though not yet. There was a recent  
announcement  
that JRuby will gain the ability to dump the bytecode result of any  
evaluation  
– this means that if your program is well-behaved (properly  
object-oriented,  
for example), it should mostly compile directly to Java bytecode.

Well, sort of. If you’re familiar with v8 snapshots (v8 is Google’s  
Javascript  
engine), I think it’s the same idea.

I don’t think that exists _yet_, though I hope Rawr picks it up when it  
does  
– not because I want obfuscation, but because it would improve startup  
time  
by a lot.

---

<div class="post-metadata">

**Author:** ![elricstorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/da6949/32.png) [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Post date:** [February 1, 2010, 11:30pm UTC](https://www.ruby-forum.com/t/packaging-source-files-on-multiple-oss/182637/6 "2010-02-01T23:30:40Z")

</div>

Thanks guys - appreciate the responses.

---

<div class="post-metadata">

**Author:** ![elricstorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/da6949/32.png) [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Post date:** [February 1, 2010, 11:12pm UTC](https://www.ruby-forum.com/t/packaging-source-files-on-multiple-oss/182637/7 "2010-02-01T23:12:29Z")

</div>

Alpha B. wrote:

> Marnen Laibow-Koser wrote:
> 
> > Monkeybars uses Rawr and JRuby to do exactly what you’re talking about.
> 
> Thanks Marnen, I did try out monkeybars but I didn’t like the library.

What about Rawr without Monkeybars, then?

(And BTW, let me assure you that Monkeybars is a joy to work with.  
Almost as nice as Rails.)

> I have become very familiar with WxRuby now and have dug deep into the  
> API. I’m going to stick with WxRuby and hopefully either crate comes up  
> to speed, or I’ll use ocra for windows packaging (which now works for  
> me) and come up with alternative packaging for other OS’s.

There’s really no good way except for JRuby, as far as I can tell.  
You’re kind of putting effort into a dead end IMHO.

> My last issue has to do with lack of obfuscation, which I only want to  
> apply to my source code and not to the ruby libraries that are packaged  
> with my code. I may have to create an obfuscator myself, but that’s a  
> long and tedious process.

JRuby can help with this too – particularly with Rawr, which complies  
your Ruby files into Java class files. Otherwise, don’t bother.  
Obfuscation is risky and almost never worth it.

> Thanks again.

Best,  
–Â  
Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
