Sunday, February 25, 2007

Distributing Ruby Apps on Windows

So, you've developed a Ruby script or application for Windows. You'd like to compile the application into a portable executable file (EXE) that you can easily provide to your users without requiring them to install Ruby and the required libraries. Reach for RubyScript2Exe, Erik Veenstra's Ruby compiler. RubyScript2Exe traces and gathers all the necessary files, including the Ruby interpreter, and 'compiles' them into a single EXE file. You can easily embed images and icon files, and DLLs such as SQLite. RubyScript2Exe is easy to configure, very reliable, and well-documented and supported by the author. Executable files are 3-4mb in size for a typical wxRuby (0.6) application.

UPDATE: I have posted a new article with further details on using RubyScript2Exe, here.

To make compiling your Ruby apps even easier, install LopeSoft's free File Menu Tools and add a new file menu command for RubyScript2Exe. Then just right-click on your Ruby script in Windows explorer and select 'Compile with RubyScript2Exe'.

Speaking of compiling Ruby apps on Windows, keep an eye on the Gardens Point Ruby.NET Compiler project at Australia's Queensland University of Technology. I haven't done much with it yet but it looks promising.

Thanks for stopping by!

Digg my article

5 comments:

RadixHound said...

Thanks for the tip.

I'm interested in knowing how well you find this works with a GUI toolkit. Does that get packaged up all nice within the exe as well?

David Mullet said...

I currently use wxRuby (0.60) for my GUIs. My completed EXEs (created by RubyScript2Exe) are approximately 3mb in size. The EXE contains all the necessary libraries.

I've developed at least a dozen desktop apps using wxRuby and RubyScript2Exe and I have been very happy with the results.

I'm interested to see how IronRuby and the Ruby.Net compiler evolve in the coming months, but RubyScript2Exe and wxRuby meet my current needs.

chovy said...

Does anyone have a list of open source wxruby apps? I'd like to write one as a demo.

David Mullet said...

@chovy:

I don't have a list of multiple apps, but I do believe that Weft QDA is an open source app, and uses wxRuby.

Hope that helps.

free ps3 said...

Thanks for the nice post!