Ruby file to Executable file -- for all OS

J

jazzez ravi

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
http://raveendran.wordpress.com
 
D

David Masover

jazzez said:
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.
 
D

David Masover

Chad said:
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.
 
D

David Masover

Chad said:
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 -- 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.
 
J

Jarmo Pertman

Louis-Philippe said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top