Deploying a Hobo app to Heroku

December 28th, 2009

Hobo and Heroku make for a killer combination for getting your app built and deployed in record time.

These instructions are for Hobo 0.9.102. If you’re using an older version the steps may differ.

$ hobo myapp
$ cd myapp
$ git init
$ heroku create yourappname

Create a .gems file, since Hobo isn’t pre-installed on Heroku:

hobo --version 0.9.102

It is recommend to specify a particular version of any gem you use, in case a future release isn’t fully backwards compatible. (There’s no longer any need to specify will_paginate here.)

Next, create a .gitignore file:

log/*
db/*.sqlite3

Generate the database migrations:

$ script/generate hobo_migration

Choose [m] to migrate now and give it a name such as create users.

To generate the auto dryml files in app/views/taglibs/auto/, you’ll need to access the site once locally. Hobo cannot create these on Heroku because the filesystem is read-only. So run:

$ script/server

And open http://localhost:3000 in your browser.

You can then add all your files into the git repository, and push them to Heroku:

$ git add *
$ git add .gems
$ git add .gitignore
$ git commit -m "initial import" 
$ git push heroku master

It will take a couple of minutes to install the Hobo gem the first time you deploy, but subsequent deployments will be faster.

Next, run the database migration on Heroku:

$ heroku rake db:migrate

If you don’t see any error message, then you should be good to go:

$ heroku open

Common Problems

If you see the Rails “something went wrong” error, use heroku console to view the error log.

  • “relation “users” does not exist” – you probably forgot to run heroku rake db:migrate

1 Response to “Deploying a Hobo app to Heroku”

  1. Chris Says:

    Great thanks!

Leave a Reply