Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

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

By Peter Cooper / October 21, 2010

appstoreformac.pngAt 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!


  1. Antonio Cangiano says:

    A bit of a shameless plug, but people may be interested in our "Introduction to MacRuby and HotCocoa":

    It normally costs $9, but if you use the coupon RUBYINSIDEROCKS today only, you'll be able to buy it for 5 bucks.

    (Peter, I hope you don't mind.)

  2. Steve Klabnik says:

    I intend to try and get Hackety Hack in there.

  3. Jake says:

    With MacRuby's migration to LLVM, isn't this debate a moot point? Compile it into a native Mach-O and upload it to the App Store.

  4. Michael says: sez “deprecated or optionally-installed technologies” will be rejected from the App Store this would include MacRuby, no?

  5. Dennis says:

    From the Mac Developer web site:

    Objective-C’s dynamic runtime is similar to many modern scripting languages, making it easy to map Cocoa’s features to other languages using the Cocoa Bridge. With the Cocoa Bridge, developers can create first-class Mac OS X applications using AppleScript, Ruby, and Python.

  6. Travis Tilley says:

    Looking at the commit log for macruby, it seems that using a nightly build might be necessary for this:

    Date: Tue Oct 19 05:56:37 2010 +0000
    +[MacRuby sharedRuntime]: make the load path relocatable in case MacRuby.framework is embedded in a .app

  7. Marcelo Alves says:

    There's nothing to prohibits you to bundle entire MacRuby inside your application. The problem lies if you NEED something deprecated, like Java, Flash or Rosetta. If you bundle Java/Ruby or another ancient piece of code inside your application, there's no dependency on something optionally installed or deprecated to make Apple block the app.

Other Posts to Enjoy

Twitter Mentions