Sunday, September 6, 2009

BucketWise + Heroku => Profit!

I've been working with Jamis Buck's BucketWise and enjoying the control I exercise over my spending. But... I started with a local installation and it was good, but not so shareable. So... I tried installing at DreamHost, but things were not so compatible. Finally, I was messing with Heroku and found interesting info about how to install BucketWise there.

It seems that BucketWise uses git external references to pull in its plugin dependencies. Heroku uses git to manage applications, as in doing a git push (or similar) to deploy an application from a local repository to its Heroku location. Unfortunately, Heroku doesn't handle the external references. and leaves the plugins out of the deploy.

I found a fork by Tony Eichelberger (http://github.com/watkyn) that pulls out the git externals stuff and includes the plugins directly in the repository. doing a git clone from there and doing the Heroku setup stuff in the clone directory results in a working Heroku app.

There's a bit of a problem setting up the application once it's running. Heroku doesn't seem to support interactive Rake commands so I got into the Heroku console and directly created a new user and subscription to use.
  1. Clone the repository
    git clone git://github.com/watkyn/bucketwise.git bucketwise
  2. Create the Heroku app
    heroku create my-bucketwise-app
    git push heroku
    heroku rake db:schema:load
  3. Setup BucketWise
    heroku console
    >> user = User.create({:name => 'Full Name', :email => 'email@server.com', :user_name => 'username', :password => 'FancyPass234'})
    >> sub = Subscription.create(:owner => user)
    >> user.subscriptions << sub
  4. Login & Profit!

BTW, I haven't tried it but the plugin changes here probably make the system work in DreamHost.