Apr 062009
 

UPDATE!
Cowlibob did a fix, find it at : http://github.com/cowlibob/rubyscript2exe

Untested!
From ‘The Higgs bozo’ on the ruby newsgroup. Apply change to both rubyscript2exe and tar2rubyscript. As far as I know that makes it work with newer versions of Ruby but I didn’t get to play with it yet.

— rubyscript2exe.rb.orig 2009-04-03 10:28:41.140806000 -0400
+++ rubyscript2exe.rb 2009-04-03 10:29:40.108423800 -0400
@@ -618,7 +618,7 @@

newlocation do
if __FILE__ == $0
- $0.replace(File.expand_path(“./init.rb”))
+ $0 = File.expand_path(“./init.rb”)

TAR2RUBYSCRIPT = true unless defined?(TAR2RUBYSCRIPT)

Jan 232009
 

Erik Veenstra created two scripts, tar2rubyscript and rubyscript2exe, which essentially grab what you wrote, wrap it up with some other code, bundle it with the ruby executable, and spit out a finished, executable package – which will run on that same OS — so compile it on Windows, get a Windows executable, compile on Linux, get Linux executable, etc.
tar2rubyscript
rubyscript2exe

As I’m a newb, it took me a while to figure out that I need .. ‘stuff’ in the init.rb file. Since I’m writing scripts, I just stuffed the whole simple script in init.rb.. This also means I don’t really understand how to do bigger programs, but I think that with more knowledge than mine, these pages are worth their weight in pixels. Made of gold.