Will Reed

Code simple

Ruby + Merb on Google App Engine

leave a comment »

Google recently added limited support for Java on app engine. Like many other ruby on rails developers, I immediately thought of using Jruby to run a ruby app on the app engine jvm. The upshot is, it works – at a price.

The major downside is that you lose Active Record. Google, of course, has its own BigTable data layer implementation. I think a rails-like wrapper is inevitable – Ola Bini is already working on one (Bumble) – but that won’t help much for now. BigTable is basically just a massively distributed object hash, so the API mostly revolves around creating and modifying data objects. Not pretty, fairly inelegant, but it works.

I won’t go through the precise steps to set this up, because that’s already been done here. Those steps worked perfectly for me, with one caveat. Make sure you set the following props to false in config/init.rb:
c[:reload_classes] = false,
c[:reload_templates] = false,

Those can be set to true in dev for testing, but you’ll get an unhelpful permissions exception when you deploy to app engine if you don’t first set them to false.

Why Merb? Mostly because that’s what the setup directions used, but also because you can’t use ActiveRecord anyway. I also read that Merb is basically getting taken over/taking over Rails anyhow.

Written by willreed

May 4, 2009 at 9:31 am

Posted in Code

Leave a Reply