It is possible, using "Ocra" gem. (There are also some other ways, but
this one is the simplest.)

Just `gem install ocra`, then run `ocra yourscript.rb`. The script
will now be executed once, then Ocra will collect all the dependencies
and pack them in a single exe, along with the script. (You probably
need to do this on a Windows computer wih Ruby installed.) A
yourscript.exe file will be generated, you should be able to run it on
any Windows machine.

Internally, this .exe file will unpack Ruby interpreter, libraries and
the script to a temporary directory, run it, then clean up after
itself.


If your script requires or reads anything from the directory you run
it in, you'll probably also need to add these two lines to the top of
it to make it work with Ocra:

$:.unshift File.dirname($0)
Dir.chdir File.dirname($0)


You can read further docs on RubyGems.org.


2011/8/11 Michelle Pace <michelle / michellepace.com>:
> Hello there,
>
> I'm a newbie. I have written a ruby program on my mac which uses
> NET::HTTP. There's no GUI, its all working via terminal input from the
> user. My program however needs to be invoked and run from a windows
> machine.
>
> Is there a way to make my little program a standalone executable so that
> my user can double click the exe and run it as per normal from their
> windows machine? I would prefer to avoid installing ruby on the windows
> machine (if I can).
>
> Is this possible, and if it is how do I go about it?
>
> Thank-you in advance, Michelle
>
> --
> Posted via http://www.ruby-forum.com/.
>
>