Exceptional and Heroku - Simple!

We had the pleasure of meeting Morten Bagji from Heroku recently who told us all about their platform. We love how beautifully simple it is ...

"It's like a rails deployment vending machine"

Getting a brand new Rails application deployed on Heroku with Exceptional is really simple. The steps below should take you no more than 5 minutes in total.

Before you start you will need:

Creating a Heroku & Exceptional rails application

1. Create a new rails application

$ rails blog

2. Add some functionality to the new app

$ ./script/generate scaffold Post title:string body:text

3. Test the new application to make sure its working

$ rake db:migrate
$ ./script/server

Open up http://localhost:3000/posts

4. Create a new application on getexceptional.com

If you do not already have an exceptional account, then you can sign up for free one, if you like.

Otherwise, create new app within your Exceptional account and give it a name (e.g "My Exceptional Heroku Blog")

5. Install The Exceptional Plugin

$ script/plugin install git://github.com/contrast/exceptional.git

6. Configure the Exceptional Plugin with the Exceptional API Key

Edit the config/exceptional.yml file and overwrite PASTE_YOUR_API_KEY_HERE with your exceptional API_Key (available from the 'installation instructions' screen within Exceptional)

7. Initialize this rails application as a git repository

$ git init
$ git add .
$ git commit -m "My New Exceptional Heroku Rails App"

8. Install the Heroku Gem

$ sudo gem install heroku

9. Create your application on Heroku

You will need to enter your Heroku name and password during this step

$ heroku create MyExceptionalHerokuBlog

10. Push your code to Heroku

$ git push heroku master

11. Test your new heroku app in your browser

$ heroku open

Navigate to /posts

12. Error!!

You will suddenly get an error form your Rails application. Go to Exceptional and you will quickly see the problem:

ERROR: relation \"posts\" does not exist\n: SELECT * FROM \"posts\" " 

13. Migrate the Heroku Database

$ heroku rake db:migrate

14. Test the heroku app again ... all should work beautifully

$ heroku open

Navigate to /posts.

Simple!