Saturday, July 4, 2009

I <3 Heroku

I've been aware of Heroku for a while, but my first reaction was "that sounds like an awfully restrictive hosting environment." Man was I wrong. Forget Capistrano. Don't mourn the loss of SSH access (you can still run shell commands from the console). Give it a try and git push heroku will almost surely become your new favourite command. This is what Rails deployment should be, elegant and incredibly well thought out!

One thing that took a bit of getting used to was declaring gem dependencies, but even that I grew to like. Since the system needs to know if any new gems are required before trying to restart your app and having it explode, the typical method of declaring gem dependencies in environment.rb won't do. Instead, you create a plain text file called .gems in the root of your application, listing the names, sorces and versions of the gems you need. Environment.rb has always seemed a strange place for this, frought with danger (anyone who's tried to run Radiant on Dreamhost can tell you all about it!). I think this should be the way it's done in Rails 3 and beyond.

A friend's been trying out Heroku Garden, which allows you to edit your code (or play around in the console, install plugins and gems, or almost anything else you'd need to do) in your browser. You can even invite others to contribute. Though, beware that there's no protection against someone beating you to the Save button and wiping out your work.

Heroku isn't for everyone. It's got a few limitations you may not expect (most notably, a read-only file system, since it runs on EC2). But overall, I've been quite pleased so far.

If you're viewing this on Blogspot or the Tapioca Collective site (or anywhere else for that matter), come check out my new online home.

No comments:

Post a Comment