Installing Jekyll

If you are using Python 3 as a standard, the Jekyll installation from homebrew might give you problems, because the Jekyll installation out-of-the box uses the syntax higlighter Pygments, which does not work under Python 3. This is the rather mysterious error I got:

$ jekyll serve --trace
Configuration file: /Users/mok/github/
Source: /Users/mok/github/
Destination: /Users/mok/github/
Liquid Exception: No header received back. in _posts/2015-05-02-welcome-to-jekyll.markdown

Instead, use the Ruby highlighter rouge. In _config.yml, add:

highlighter: rouge

and install the rouge highlighter gem:

gem install rouge

Now the installation should go without problems.

Install newer version of Ruby on OS X Yosemite

Following this video:

$ brew update

First install rbenv:

$ brew install rbenv
$ brew info rbenv
$ emacs .bashrc

Execute (and add to .bashrc):

export RBENV_ROOT=/usr/local/var/rbenv
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

Now we have rbenv installed. See if it works:

$ rbenv

We need to install the ruby-build plugin. Clone the git directory directly into the rbenv plugin directory in the homebrew managed tree:

$ cd /usr/local/var/rbenv/
$ mkdir plugins
$ cd plugins/
$ git clone --depth=1
$ rbenv

rbenv now has some new commands, e.g. install. What versions of Ruby are available?

$ rbenv install --list

Install newest one (2.2.2 as of now):

$ rbenv install 2.2.2
$ ruby --version
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]

Still running system Ruby version, use rbenv to switch:

$ rbenv global 2.2.2
$ ruby --version
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]

Now we are running 2.2.2. Install the bundler gem:

 $ gem install bundler

Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed.