Sunday, May 3, 2009

RubyScript2Exe and RubyGems

I've written here previously about Erik Veenstra's RubyScript2Exe "compiler". I use it frequently to create standalone EXE files on Windows.

If you use RubyScript2Exe, you should note that the current version (0.5.3) doesn't appear to play well with the new version (1.3.2) of Rubygems released a few weeks ago. Attempting to compile a script results in the error:

undefined method `list' for Gem::Specification:Class

Some additional discussion can be found in this Ruby Forum thread.

Perhaps Erik will update RubyScript2Exe to utilize the Gem.loaded_specs method, as suggested by Eric Hodel.

In the meantime, RubyGems 1.3.1 continues to work well for me with RubyScript2Exe. Be aware, however, that Daniel Berger points out in the above thread that version 1.3.2 addresses a couple issues related to the win32-file library.

There are alternatives emerging for creating executables from your Ruby code, including ocra and crate. I haven't had the opportunity to try either of these yet, but plan to in the near future. If you have experience with these or similar tools, feel free to share your comments here. Thanks!


BackOrder said...

Hello David. Always interesting to read your blog. You can have an insight of my experience with "Crate On Windows" on my very own blog:

Luis said...

As BackOrder pointed out, Crate support on Windows is lacking.

There is also exerb project which could possibly work.

CjK said...

Since I couldn't get RUBYSCRIPT2EXE to work on my (Windows-) System, I gave "ocra" a try. My limited experience so far is very positive. It worked out of the box with minimum effort.

I recomment ocra!

PS: Big thanks from me for providing all this useful information here. It saved me time numerous times!