Ruby file to Executable file -- for all OS

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

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

jazzez ravi wrote:

I have a ruby script. i converted it into exe with the help of
rubyscript2exe gem.

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

So there is no way to do that …?

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.

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

also, Shoes would do it for almost all platform (3 big at least)
http://shoooes.net/
but then you have a Shoes app, and not a ruby script.

2009/2/10 jazzez ravi [email protected]

On Tue, Feb 10, 2009 at 06:25:44PM +0900, David M. 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.

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.

David M. 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://rubyforge.org/projects/jazzez

On Mon, Feb 16, 2009 at 05:59:39PM +0900, David M. wrote:

Chad P. 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.

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.

Chad P. 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.

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.

Chad P. wrote:

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.

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…

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 Tue, Feb 17, 2009 at 08:35:58AM +0900, David M. wrote:

I suppose that is best for brand-new users. However, it is a lot of
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.

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.

Hi Jarmo P.,

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

Thanks
P.Raveendran

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

Louis-Philippe wrote:

there is rubyscript2exe which would do it for windows at least:
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