# Ruby file to Executable file -- for all OS

**URL:** https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628
**Category:** ruby-talk
**Created:** [9 February 2009 06:02 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628 "2009-02-09T06:02:01Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Raveendran\_P](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Raveendran\_P](https://rubytalk.org/u/Raveendran_P)
#### Post date: [9 February 2009 06:02 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628/1 "2009-02-09T06:02:01Z")

</div>

Hi All,

I have a ruby script. i converted it into exe with the help of  
rubyscript2exe gem. But it was working in windows machines only..

My Need:

I want to run all the Operating systems. is this possible ?  
(I hope some gems will be available)

Thanks in advance,  
P.Raveendran

> **[Raveendran](https://raveendran.wordpress.com/)**
>
> Nothing is impossible...

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

### Author: ![Raveendran\_P](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Raveendran\_P](https://rubytalk.org/u/Raveendran_P)
#### Post date: [10 February 2009 09:06 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628/2 "2009-02-10T09:06:20Z")

</div>

Hi All,

So there is no way to do that ..?

Right.. ? ok I am trying to find out others ways ..

Thanks,  
P.Raveendran  
[http://raveendran.wordpress.com](http://raveendran.wordpress.com)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

### Author: ![David\_Masover](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@David\_Masover](https://rubytalk.org/u/David_Masover)
#### Post date: [10 February 2009 09:25 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628/3 "2009-02-10T09:25:44Z")

</div>

jazzez ravi wrote:

> I have a ruby script. i converted it into exe with the help of  
> rubyscript2exe gem.  
> &nbsp;&nbsp;I want to run all the Operating systems. is this possible ?  
> (I hope some gems will be available)  
> &nbsp;&nbsp;

...

> So there is no way to do that ..?  
> &nbsp;&nbsp;  
> It might be your English... I mean no offense, it's just difficult to understand. Do you mean, you want to create a single executable for each operating system Ruby runs on? So I can just download your program on OS X, or on Linux, without having Ruby installed?

Probably not.

Mostly there's no need. Worse, it's a bad idea, and will probably make your users hate you.

Let me put it this way: Suppose your app is a few hundred kilobytes. My current installation of Ruby is at least five and a half megabytes (probably more), and that's not counting any rubygems you include. My current Rubygems folder is over six hundred megabytes.

So, what would be a few seconds, or near instantaneous, is now several minutes or hours. But I already have Ruby installed, and probably many of the gems I would need, so it's a complete waste.

If you want to distribute your app in the friendliest way, that makes it easiest for users of any OS to install it, build a gem. There's a reasonably easy way to install Ruby and Rubygems on any OS, and once that's there, it's easy to install your gem.

It's also possible I misread, and you actually want a single .exe file which can run on all operating systems -- also, presumably, without asking your users to install anything first. That is impossible -- those files are for Windows only, except the .NET ones, and only Windows comes with .NET out of the box.

---

<div class="post-metadata">

### Author: ![Raveendran\_P](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Raveendran\_P](https://rubytalk.org/u/Raveendran_P)
#### Post date: [10 February 2009 09:44 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628/4 "2009-02-10T09:44:50Z")

</div>

David Masover wrote:

> It's also possible I misread, and you actually want a single .exe file  
> which can run on all operating systems -- also, presumably, without  
> asking your users to install anything first. That is impossible --

Thanks David.

regards,  
P.Raveendran  
[http://raveendran.wordpress.com](http://raveendran.wordpress.com)  
[http://rubyforge.org/projects/jazzez](http://rubyforge.org/projects/jazzez)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

### Author: ![Chad\_Perrin1](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@Chad\_Perrin1](https://rubytalk.org/u/Chad_Perrin1)
#### Post date: [15 February 2009 01:55 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628/5 "2009-02-15T01:55:31Z")

</div>

This has its ups and downs. The down is that someone has to install  
other stuff before installing the application -- and if you're developing  
for typical end users, telling them "Go install Ruby and Rubygems, then  
come back here and install it," will make them look for an alternative  
(or, if that's not an option, it will probably at least make them curse  
your name).

Generally, I think the best way to do it is to provide several different  
ways to install stuff, if you want cross-platform easy installs and your  
userbase will consist of more than just Ruby programmers.

> **···**
>
> On Tue, Feb 10, 2009 at 06:25:44PM +0900, David Masover wrote:
> 
> > If you want to distribute your app in the friendliest way, that makes it  
> > easiest for users of any OS to install it, build a gem. There's a  
> > reasonably easy way to install Ruby and Rubygems on any OS, and once  
> > that's there, it's easy to install your gem.
> 
> --  
> Chad Perrin [content licensed OWL: [http://owl.apotheon.org](http://owl.apotheon.org) ]  
> Quoth Anonymous: "Blind faith is an ironic gift to return to the Creator  
> of human intelligence."

---

<div class="post-metadata">

### Author: ![Louis-Philippe](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@Louis-Philippe](https://rubytalk.org/u/Louis-Philippe)
#### Post date: [10 February 2009 13:42 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628/6 "2009-02-10T13:42:36Z")

</div>

there is rubyscript2exe which would do it for windows at least:  
[http://www.erikveen.dds.nl/rubyscript2exe/](http://www.erikveen.dds.nl/rubyscript2exe/)

also, Shoes would do it for almost all platform (3 big at least)

> **[shoooes.net - This website is for sale! - shoooes...](http://ww16.shoooes.net/?sub1=20240109-1425-32f9-a142-d8f4e851e103)**
>
> This website is for sale! shoooes.net is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, shoooes.net has it all. We hope you find what you are searching for!

but then you have a Shoes app, and not a ruby script.

> **···**
>
> 2009/2/10 jazzez ravi \<jazzezravi@gmail.com\>
> 
> > David Masover wrote:  
> > \>  
> > \> It's also possible I misread, and you actually want a single .exe file  
> > \> which can run on all operating systems -- also, presumably, without  
> > \> asking your users to install anything first. That is impossible --
> > 
> > Thanks David.
> > 
> > regards,  
> > P.Raveendran  
> > [http://raveendran.wordpress.com](http://raveendran.wordpress.com)  
> > [http://rubyforge.org/projects/jazzez](http://rubyforge.org/projects/jazzez)
> > 
> > --  
> > Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

### Author: ![David\_Masover](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@David\_Masover](https://rubytalk.org/u/David_Masover)
#### Post date: [16 February 2009 08:59 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628/7 "2009-02-16T08:59:39Z")

</div>

Chad Perrin wrote:

> Generally, I think the best way to do it is to provide several different  
> ways to install stuff, if you want cross-platform easy installs and your  
> userbase will consist of more than just Ruby programmers.  
> &nbsp;&nbsp;  
> I suppose that is best for brand-new users. However, it is a lot of work, and it means there may be some confusion as to which version is the latest, and how to keep up to date.

Generally, even as a user, I find that I would much rather have a few lines to paste into the terminal -- even better if I understand them -- than have to download something, find it, doubleclick on it, and maybe still have to type a few lines in the terminal.

For example, I would tell Ubuntu Intrepid users to do this:

sudo apt-get install rubygems  
sudo gem intsall myapp

Or maybe, even better:

sudo sh -c 'apt-get install rubygems && gem install myapp'

Quicker for the user, probably quicker for the developer.

---

<div class="post-metadata">

### Author: ![Chad\_Perrin1](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@Chad\_Perrin1](https://rubytalk.org/u/Chad_Perrin1)
#### Post date: [16 February 2009 22:18 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628/8 "2009-02-16T22:18:00Z")

</div>

> Chad Perrin wrote:  
> \>Generally, I think the best way to do it is to provide several different  
> \>ways to install stuff, if you want cross-platform easy installs and your  
> \>userbase will consist of more than just Ruby programmers.  
> \>
> 
> I suppose that is best for brand-new users. However, it is a lot of  
> work, and it means there may be some confusion as to which version is  
> the latest, and how to keep up to date.

Not just new users -- non-technical users in general.

> Generally, even as a user, I find that I would much rather have a few  
> lines to paste into the terminal -- even better if I understand them --  
> than have to download something, find it, doubleclick on it, and maybe  
> still have to type a few lines in the terminal.

I agree -- but then, I'm a technically oriented user on an OS that  
basically just installs gems for me. I'm not a non-technical user on MS  
Windows.

> For example, I would tell Ubuntu Intrepid users to do this:
> 
> sudo apt-get install rubygems  
> sudo gem intsall myapp
> 
> Or maybe, even better:
> 
> sudo sh -c 'apt-get install rubygems && gem install myapp'
> 
> Quicker for the user, probably quicker for the developer.

Sure, but I'd suggest a different approach for a user of MS Windows that  
doesn't want to have to install gems before installing the application.

> **···**
>
> On Mon, Feb 16, 2009 at 05:59:39PM +0900, David Masover wrote:
> 
> --  
> Chad Perrin [content licensed OWL: [http://owl.apotheon.org](http://owl.apotheon.org) ]  
> Quoth Reginald Braithwaite: "Nor is it as easy as piling more features  
> on regardless of how well they fit or whether people will actually use  
> them. Otherwise Windows would have 97% of the market and OS X 3%. (Oh  
> wait.)"

---

<div class="post-metadata">

### Author: ![Jarmo\_Pertman](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Jarmo\_Pertman](https://rubytalk.org/u/Jarmo_Pertman)
#### Post date: [27 February 2009 13:33 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628/9 "2009-02-27T13:33:55Z")

</div>

Louis-Philippe wrote:

> there is rubyscript2exe which would do it for windows at least:  
> [http://www.erikveen.dds.nl/rubyscript2exe/](http://www.erikveen.dds.nl/rubyscript2exe/)

Sorry for bringing up old thread, but how come you didn't notice on  
rubyscript2exe web page: "RubyScript2Exe transforms your Ruby  
application into a standalone, compressed Windows, Linux or Mac OS X  
(Darwin) executable."

The only thing is that you have to make this executable on all of these  
OS-es separately. So, you run rubyscript2exe in Linux and in Windows and  
you get 2 different executables - one for Linux, other for Windows. As  
it's normally almost with every other applications.

Anyway, you should give it a try. Since it includes all the necessary  
libraries for your application + Ruby itself, then there's no need to  
install Ruby specifically, which makes it a lot easier for non-techy  
people to use your application.

Also, when I tried to create .exe on Windows (I had quite small Ruby  
application), it's size was about 2MB - nothing significant in today's  
world, is it?

Jarmo

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

### Author: ![David\_Masover](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@David\_Masover](https://rubytalk.org/u/David_Masover)
#### Post date: [16 February 2009 23:35 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628/10 "2009-02-16T23:35:58Z")

</div>

Chad Perrin wrote:

> &nbsp;&nbsp;
> 
> > Chad Perrin wrote:  
> > &nbsp;&nbsp;&nbsp;&nbsp;
> > 
> > > Generally, I think the best way to do it is to provide several different  
> > > ways to install stuff, if you want cross-platform easy installs and your  
> > > userbase will consist of more than just Ruby programmers.
> > 
> > I suppose that is best for brand-new users. However, it is a lot of work, and it means there may be some confusion as to which version is the latest, and how to keep up to date.  
> > &nbsp;&nbsp;&nbsp;&nbsp;  
> > Not just new users -- non-technical users in general.  
> > &nbsp;&nbsp;  
> > Non-technical users in general would benefit even more from a good package management system. Much easier to run a 'gem update', even if you have to use that scary, scary commandline, than it is to go find the website, compare the versions, uninstall the old one, download the new one, and install it all over again.

> > Generally, even as a user, I find that I would much rather have a few lines to paste into the terminal -- even better if I understand them -- than have to download something, find it, doubleclick on it, and maybe still have to type a few lines in the terminal.  
> > &nbsp;&nbsp;&nbsp;&nbsp;  
> > I agree -- but then, I'm a technically oriented user on an OS that  
> > basically just installs gems for me. I'm not a non-technical user on MS  
> > Windows.  
> > &nbsp;&nbsp;  
> > On MS Windows, probably the best advice would be to find a one-click application which installs Ruby and Rubygems, and then provide the same instructions -- open a terminal and type 'gem install myapp'. Ideally, you'd have a script (a batchfile?) which checks for the existence of Rubygems, downloads it if needed, and then downloads your app...

I would suggest that the right approach is to fix usability problems with Rubygems (or replace it with something better?), rather than having each app have to solve these same problems all over again.

And let's not forget, everywhere but Windows, there are a few commands that would work for that initial installation. Only on Windows do we need anything elaborate.

> **···**
>
> > On Mon, Feb 16, 2009 at 05:59:39PM +0900, David Masover wrote:

---

<div class="post-metadata">

### Author: ![Raveendran\_P](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Raveendran\_P](https://rubytalk.org/u/Raveendran_P)
#### Post date: [28 February 2009 04:59 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628/11 "2009-02-28T04:59:21Z")

</div>

Hi Jarmo Pertman,

Its great idea from you. I will try and let you know the result.

Thanks  
P.Raveendran

> **[Raveendran](https://raveendran.wordpress.com)**
>
> Nothing is impossible...

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

### Author: ![Chad\_Perrin1](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@Chad\_Perrin1](https://rubytalk.org/u/Chad_Perrin1)
#### Post date: [17 February 2009 19:02 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628/12 "2009-02-17T19:02:15Z")

</div>

> Chad Perrin wrote:  
> \>  
> \>\>Chad Perrin wrote:  
> \>\>  
> \>\>\>Generally, I think the best way to do it is to provide several different  
> \>\>\>ways to install stuff, if you want cross-platform easy installs and your  
> \>\>\>userbase will consist of more than just Ruby programmers.  
> \>\>\>  
> \>\>\>  
> \>\>I suppose that is best for brand-new users. However, it is a lot of  
> \>\>work, and it means there may be some confusion as to which version is  
> \>\>the latest, and how to keep up to date.  
> \>\>  
> \>  
> \>Not just new users -- non-technical users in general.  
> \>
> 
> Non-technical users in general would benefit even more from a good  
> package management system. Much easier to run a 'gem update', even if  
> you have to use that scary, scary commandline, than it is to go find the  
> website, compare the versions, uninstall the old one, download the new  
> one, and install it all over again.

I agree that non-technical users would benefit from a good software  
management system. Too bad most of them don't have such a thing by  
default -- so to get their hands on one even for so limited a case as  
installing Ruby gems, they first have to go through the effort of  
installing the software management system and the language's interpreter  
without the benefit of a software management system. Installing a Ruby  
application that depends on the Ruby-specific software management system  
is still an operation with too many steps.

> \>\>Generally, even as a user, I find that I would much rather have a few  
> \>\>lines to paste into the terminal -- even better if I understand them --  
> \>\>than have to download something, find it, doubleclick on it, and maybe  
> \>\>still have to type a few lines in the terminal.  
> \>\>  
> \>  
> \>I agree -- but then, I'm a technically oriented user on an OS that  
> \>basically just installs gems for me. I'm not a non-technical user on MS  
> \>Windows.  
> \>
> 
> On MS Windows, probably the best advice would be to find a one-click  
> application which installs Ruby and Rubygems, and then provide the same  
> instructions -- open a terminal and type 'gem install myapp'. Ideally,  
> you'd have a script (a batchfile?) which checks for the existence of  
> Rubygems, downloads it if needed, and then downloads your app...

. . . but it would be easier to just supply a one-click installer for the  
application itself, such as is available for most C/C++ apps on MS  
Windows.

> I would suggest that the right approach is to fix usability problems  
> with Rubygems (or replace it with something better?), rather than having  
> each app have to solve these same problems all over again.

Oh, sure, I agree -- but until that happens, some of us will still need  
to have a way to work around any such problems when we want to distribute  
our applications. I'm not talking about a permanent solution so much as  
a stopgap until the state of the art for easy cross-platform software  
distribution advances to the point where the stopgap is no longer  
necessary.

> And let's not forget, everywhere but Windows, there are a few commands  
> that would work for that initial installation. Only on Windows do we  
> need anything elaborate.

Indeed. That's why I said, a couple emails further up the thread, that  
for many cases the "right" way to handle it in the here-and-now is to  
provide several different options for people to install applications  
written in Ruby. One, of course, would be to use gems on (for instance)  
FreeBSD. Another would be a one-click application installer for MS  
Windows users who are unlikely to want or need to maintain an entire Ruby  
ecosystem for multiple apps and a slew of libraries.

> **···**
>
> On Tue, Feb 17, 2009 at 08:35:58AM +0900, David Masover wrote:
> 
> > \>On Mon, Feb 16, 2009 at 05:59:39PM +0900, David Masover wrote:
> 
> --  
> Chad Perrin [content licensed OWL: [http://owl.apotheon.org](http://owl.apotheon.org) ]  
> Quoth Jeff Henager: "If the average user can put a CD in and boot the  
> system and follow the prompts, he can install and use Linux. If he  
> can't do that simple task, he doesn't need to be around technology."

---

<div class="post-metadata">

### Author: ![Ian\_Trudel](https://avatars.discourse-cdn.com/v4/letter/i/9f8e36/32.png) [@Ian\_Trudel](https://rubytalk.org/u/Ian_Trudel)
#### Post date: [28 February 2009 05:54 UTC](https://rubytalk.org/t/ruby-file-to-executable-file-for-all-os/51628/13 "2009-02-28T05:54:22Z")

</div>

Wouldn't be crate a good candidate? I haven't tried it yet but it seems  
to do exactly what the first post ask for. Any crate user here anyway?  
It would be interesting to hear more about it.

[http://www.copiousfreetime.org/articles/2008/11/30/package-an-application-with-crate.html](http://www.copiousfreetime.org/articles/2008/11/30/package-an-application-with-crate.html)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
