MacRuby + Mac App Store == Low Hanging Fruit for Rubyists

By Peter Cooper

At its "Back To Mac" presentation yesterday, Apple unveiled the Mac App Store, an equivalent of the iOS App Store for the Mac. Given the relentless development and improvement of MacRuby and the power it brings Rubyists in developing complete OS X applications, I'm convinced that the time is right for Ruby to make a big splash on the OS X GUI app development front.

When I mentioned the above observation on Twitter, Geoffrey Grosenbach of PeepCode pointed out:

He's right, but things like app stores have a funny way of acting as catalysts for developers to come out of the woodwork and try new things out. Even taking the "evils" of app stores into account (and Apple's performed more than its fair share of evil incantations on iPhone developers), the ease with which you can put apps for sale and take money from customers (if only a 70% share) is appealing. The iPhone App Store almost reinvented casual gaming, for instance, and people I'd never have considered to try and develop a mobile app have been lured into the iPhone fold.

Given all of this, I think that if you want to develop OS X apps without moving away from Ruby, and you want to make proper money for your apps without setting up a Web site, building up traffic, and what not, now's the perfect time to look into MacRuby and Apple's Mac Developer Program. (But if you want to work on open source or sell your own stuff, do that too!)

Will Apple even allow Ruby built apps on to the App Store?

Keeping in mind the now semi-resolved 3.3.1 imbroglio, it's worth maintaining some healthy disdain as to Apple's intentions and future actions until they say something officially.

Someone's leaked the Mac Developer Program terms on to a pastebin site already, and nothing stands out to me as blocking the use of MacRuby for building App Store-deployed apps. Point 2.14 notes that apps must be packaged and submitted with Apple's own packaging tools included in Xcode, but since MacRuby is being developed at Apple, one hopes this will be easily done. Apple even has a guide called Developing Cocoa Applications Using MacRuby that digs into using Xcode.

Other points note that you can't install kexts (kernel extensions), have your own licensing system, offer "trials", download other apps from within your own, or use setuid/root privileges, but these affect the behavior of your program rather than its underlying formation.

John E Vincent suggests that point 2.24 "Apps that use deprecated or optionally installed technologies (e.g., Java, Rosetta) will be rejected" would reject the use of MacRuby. I disagree. In OS X, Java is a giant collection of frameworks maintained and updated by Apple as part of the OS, whereas you can build fully packaged, standalone OS X .app files with the MacRuby framework tightly packaged inside. I could be wrong, though - what say you?

Where next?

First, you're going to need to test the waters of building OS X GUI-based apps with MacRuby so head to the official site to download and install it. Be aware that you need to be running OS X 10.6 (Snow Leopard) or higher.

Next, read up on how to build a basic app. Choice reads include:

Not a fan of reading? Alex Vollmer and Geoffrey Grosenbach have put together a Meet MacRuby screencast. It costs $12, but you're going to be raking in the millions with your new Mac app on the App Store, right?

Finally, once you're happy with the idea of developing Mac software in Ruby, you'll need to become a member of the Mac Developer Program. This is not the same as the iOS Developer Program and you'll need to pay another $99 per year fee to get into it. What do you get? Private discussion forums, technical support, pre-release software (including OS X builds), and the ability to sign and submit Mac apps to Apple for inclusion in the Mac App Store.

Disclaimer: If Apple comes out and says you have to use Objective C for your Mac App Store apps, don't blame me!