Deploying a Hobo Rails App on Heroku
In my previous post I created my first Hobo application. I wanted to show off the fruits of the 5 minutes of hard labor to my partner, so I decided to push it to Heroku. I ran into some problems because I’m using Rails 2.3.8, which Heroku hasn’t deployed for general use. It is available on their bamboo stack.
After much fumbling and my inability to get the .gems file right (because of gem dependencies of Hobo) I decided to give Gem Bundler a try and it magically solved all my problems.
Here’s what I did…
Install Gem Bundler (gem install bundler).
Create a Gemfile with the following:
gem 'rails', '2.3.8'
gem 'hobo', '1.0.1'
Then to bundle your gems, run bundle install from your app directory. When Gem Bundler is done crunching, the next thing to do is get it up to Heroku. Since I needed to run this on their Bamboo stack, I had to create an app specifically for that stack.
First things first, add everything you need to your git repository (Heroku explains how to do this).
To create a Bamboo stack application, just run
heroku create --stack bamboo-ree-1.8.7 --remote appname
…then push your git up to Heroku…
git push appname master
…you’ll notice a lot of activity while Heroku installs gems. Hobo is a pretty complete framework so it uses a ton of them. Grab a snack while you wait.
Finally, just migrate your database…
heroku rake db:migrate --app heroku-app-name
Make sure you use the app name Heroku uses.
That’s it! I had my Hobo app running in just a few minutes. If you’re using a Rails version that doesn’t require the Bamboo stack, it should be even easier using the normal Heroku deployment tricks. I’m glad to see Gem Bundler will be the default gem management tool for Rails 3. It definitely made my life a lot easier.