I've previously mentioned Lars Christensen's One-Click Ruby Application Builder, a "compiler" for Ruby scripts that shows a lot of potential (and current value). There's not much documentation yet, but folks are installing it, using it, and providing feedback. It works right out of the box for many purposes, but here are a few things to keep in mind as you use it...
"Failed to create directory" Error
One user reported receiving the error "Failed to create directory" when running the compiled executable. As a possible workaround, try running ocra.rb from the directory where your script is located. For example, instead of running...
ocra.rb "C:\code\rubyscripts\application.rbw"
...navigate to the "C:\code\rubyscripts" directory, then run:
ocra.rb application.rbw
Note that while this resolved the problem on my machine, it didn't help the person who originally reported the problem.
Require RubyGems
When you compile your script (which uses one or more gems) with OCRA and then run the executable, you may receive a 'no such file to load' error. Try adding the line...
require 'rubygems'
...to the top of your script, above the other require statements. I've found that a script that runs pre-compiled without this statement may not execute once compiled.
Compile Without Running
I mentioned earlier that it would be nice to have an option to avoid fully running the script, similar to RubyScript2Exe's exit if RUBYSCRIPT2EXE.is_compiling? idiom. A tip of the hat goes to reader "BackOrder", who offered the following solution:
exit if Object.const_defined?(:Ocra)
Put all your require statements at the top of your code, followed by this line.
OCRA and Mechanize: "libxml2.dll not found"
There may be a problem compiling a script that requires the mechanize gem. Running the compiled executable resulted in a "libxml2.dll was not found" error on my machine.
Note that the above observations relate to version 1.0.2 (current as of this writing) of the ocra gem.
More information is available in the OCRA forums and bug tracker.
Thanks again to Lars for creating OCRA, and to the users who have installed it, used it, and provided their feedback.
Thanks for stopping by!