nullog

running, °o°, tech, life

This post has been archived, restoration is in process.

heroku

less than beta quality

After playing with jekyll on Git Hub’s pages, I realized I needed something with a bit more zest. I needed plug-in support. I found Jonas Forsberg post entitled Jekyll + Heroku + Unicorn = Blazing fast blogging and basically followed the step outlined below.

sudo gem install heroku
sudo gem install bundler
heroku auth:login
git clone git@github.com:himynameisjonas/jekyll-heroku-unicorn.git
cd jekyll-heroku-unicorn
bundle install
heroku create
git push heroku master

That lead to a complete fail.

Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
You have added to the Gemfile:
* source: https://github.com/adaoraul/ra... (at master)
You have deleted from the Gemfile:
* source: git://github.com/adaoraul/rack... (at master)
You have changed in the Gemfile:
* rack-jekyll from `https://github.com/adaoraul/ra... (at master)` to `no specified source`

Time to regroup, I searched around and found a nice how-to guide, Jekyll on Heroku by Thomas Stachl. It seem straight forward, yet it to failed. I looked around some more, and found Deploying Jekyll sites to Heroku with Rack-Jekyll which gave two little snippets of code.

gem 'rack-jekyll', :git => 'https://github.com/adaoraul/rack-jekyll.git', :require => 'rack/jekyll'

and

require 'bundler'
Bundler.require(:default, :production)

run Rack::Jekyll.new

Ah-ha, why not meld all of this goodness together. Drat, another failure.

Heroku push rejected, no Cedar-supported app detected

Hmmm, thinking… Eureka! Wait bundler isn’t the app I wish to deploy…

My new config.ru file

require 'bundler'
require "rack/jekyll"
Bundler.require(:default, :production)

run Rack::Jekyll.new(:destination => 'public')

My Gemfile

source :rubygems

gem "rake"                # actually not need for heroku but for the provided Rakefile
gem "RedCloth"            # if you want to use the Textile Markup Language
#gem "jekyll", "~> 0.11.2" # we need at least this version so jekyll will use Ruby 1.9.2
gem 'rack-jekyll', :git => 'https://github.com/adaoraul/rack-jekyll.git', :require => 'rack/jekyll'
#gem "foreman"             # this is a tool to test and use the Procfile locally
gem "heroku"              # if you install the Heroku Toolbelt you won't need this but it's good practice
gem 'unicorn'

My Procfile

web: bundle exec unicorn -p $PORT -c ./unicorn.rb

My unicorn.rb

worker_processes 4 # amount of unicorn workers to spin up
timeout 30         # restarts workers that hang for 30 seconds
preload_app true   # avoid regeneration of jekyll site for each fork

Once I deployed the app in the cloud had some curious extra data. I noticed I also forgot to included a Procfile file. I added the relevant lines redeployed the app and now I just crash. One wobbly step forward. After some thought, I noticed I forgot to include the unicorn config file. #fail.

coderay

I chose you use coderay_css: style to stylize code, this provides for inline styling. Since I dnon’t plan on providing much code examples on the site, so I don’t want to server up that style sheet all the time. However, if your planning on having alot of code snippits coderay_css: css is your option and generate your style sheet via coderay stylesheet > coderay.css

Prerequisites

Xcode – Xcode -> Preferences -> Downlads -> Install Command Line Tools

ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)
brew install git
gem update --system
gem install jekyll
gem install bundler
gem install heroku