Blogging with Marley on Heroku

January 29, 2010

Categories: ruby, marley, heroku

I don't like using crappy web interfaces to write blog posts. I also don't like writing/editing posts with no version control. I really don't like hosting my blog on my own server or paying for hosting on someone else's server. The answer to all of my complaints turned out to be Marley/Heroku. Marley is an open-source blog engine that allows posts to be written and edited in the text editor of your choice. Combine this with Heroku's git workflow and writing, editing and deploying posts becomes incredibly simple. The process goes something like this: create a new post text file, commit it to local git index, push to github (this step could be left out), push to Heroku and it's live. Also, with Marley and Heroku, you can setup a hosted blog with custom DNS for free!

Marley

http://www.restafari.org/introducing-marley.html

Marley is a ruby app built upon the Sinatra web framework. It supports comments and themes out of the box and content is written with a combination of Markdown and html/css/whatever else.

Heroku

http://heroku.com

Heroku provides a Ruby cloud platform as a service. Once your Ruby app is deployed to Heroku it can be easily scaled up or down and customized with the use of helpful add-ons.

Setting up your blog

Follow the Installation & Setup instructions on http://www.restafari.org/introducing-marley.html to get Marley running in your development environment. I checked the master branch out from github and really only tweaked the erb and css files to customize my blog layout. I also added a .gems manifest file in the root of my app with the following contents:

rdiscount --version 1.5.5

rdiscount was the only gem required by Marley that wasn't available to my Heroku app by default. Once you add the gems manifest file and push to Heroku, rdiscount will be installed on your app's dyno.

Follow the guidelines laid out in the Heroku quick start guide to get your app up and running: http://docs.heroku.com/quickstart

The only other hurdle I encountered was deploying the SQLite database. Finally I gave up and added the empty data/comments.db file to version control and that worked. Ideally, the heroku db:push sqlite://path/to/my.db command would do the trick but I couldn't get it to work.

blog comments powered by Disqus