[MacRuby-devel] ANN: ruby2app, a tool for bundling Ruby scripts into standalone Mac applications

Kevin Walzer kw at codebykevin.com
Thu Dec 4 08:08:32 PST 2014


I'm pleased to announce the initial release of ruby2app, a tool for 
bundling Ruby scripts into standalone Mac applications:

https://github.com/codebykevin/ruby2app

ruby2app is a simple command-line tool, inspired by similar Mac tools 
like py2app for Python, that bundles a Ruby script with the Ruby runtime 
into a standalone Mac application. It reads a basic configuration file 
to find the appropriate Ruby installation, compiles a small C program 
that embeds the Ruby interpreter, copies the entire Ruby installation 
into the application bundle, and re-links the relevant libraries with 
the main executable.  Ruby must be compiled with the 
"--enable-load-relative" flag for ruby2app to work.

At present the tool is primarily geared for Ruby-Tk applications, since 
Tk is the best-supported open-source GUI framework with Ruby bindings on 
the Mac in 2014, and (not coincidentally) is the one I use. But I invite 
others to submit patches to add support for other UI frameworks as well; 
Qt support might be a good candidate. Support for RubyMotion is outside 
the scope of ruby2app, as RubyMotion presumably has its own toolchain.

I am still in the process of learning Ruby, and in fact wrote this tool 
to be certain that I could deploy a Ruby-Tk application in a convenient 
manner on the Mac desktop. There are no other current tools that provide 
basic support for deployment of an open-source Mac application written 
in Ruby. Ruby-Cocoa and MacRuby are effectively dead and their tools 
(standaloneify.rb) are obsolete, RubyMotion has its own toolchain, and 
crate and rubyscript2exe do not support current versions of Ruby.

I do have a decade of experience writing Mac applications in Python, 
Perl and Tcl using the Tk toolkit, so I adapted some ideas from bundling 
tools for those languages in creating ruby2app. ruby2app is written in 
Bash, and thus should be easy to read and modify as required, and should 
fit in well to any application building toolchain.

ruby2app is available under the MIT license, and feedback is welcome.

Thank you,
Kevin
-- 
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com


More information about the MacRuby-devel mailing list