Why haven’t I blogged for a bit? Well, besides the obvious caring for twins, work, and vacations, when I sat down to write and typed, ‘jekyll serve’, into the terminal, everything was broke. Turns out that upgrading to Mojave wasn’t as benign as I thought it was going to be.

I was greeted with a plethora of errors, and a whole lot of confusion - I’m no Ruby guru, nor an OSXpert. It seemed fairly likely that upgrading to Mojave was the culprit. Some quick googling confirmed it.

So, if anyone has been facing difficulties with their Jeyll blog or with Ruby on OSX, here’s what I found:

Ruby the size of a tangerine

Install Homebrew

I installed Homebrew. Homebrew is basically a simple package manager for OSX. It helps you install a bunch of stuff that ends up being hard to install without it. You don’t need Homebrew per se, but it made my life easier.

MacOSX comes with its own version of Ruby, and that version of Ruby, in addition to being locked down, isn’t the version of Ruby that I was using to work on my blog. So: Homebrew, then. And rbenv. But I’ll get to that in a bit.

  1. Go to the Mac app store and Install Xcode.
  2. Install the Xcode Command Line Tools using your Terminal app.
    xcode-select --install
    
  3. Install Homebrew a package manager for macOS.
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  4. Install the latest version of Ruby using Homebrew.
    brew install ruby
    
  5. Check the Ruby version to confirm a successful installation.
    ruby -v
    

Now, it could be that this is enough for you to get started with Jekyll again. It wasn’t enough for me, as my Ruby environment was still set to the OSX Mojave installed version - I had issues installing gems and jekyll, so I needed a solution, which turned out to be rbenv. If you’re good at this point, you can just install jekyll and get rocking again, so skip ahead if you’re there. Otherwise, we’ve got to install rbenv and set our local Ruby environment.

Install rbenv

  1. You got Homebrew, right? Okay, so now, getting rbenv is dead easy.
    brew install rbenv ruby-build
    
  2. Set up rbenv in your shell.
    rbenv init
    

Install Ruby and Configure Your Environment

  1. Install Ruby
    rbenv install <ruby version>
    

    Now, I had some problems here. It didn’t quite work for me, so if it doesn’t for you, try this command:

    RUBY_CONFIGURE_OPTS=--with-readline-dir="$(brew --prefix readline)" rbenv install 2.4.0
    
  2. Set the path
    export PATH="$HOME/.rbenv/bin:$PATH"
    eval "$(rbenv init -)"
    
  3. Set your Ruby version:
    rbenv global <version>
    

Install Jekyll

Finally.

  1. Install Jekyll
    gem install bundler jekyll
    

Phew! You should be good to go now! It was a tiring journey finding ruby in the Mojave, but we got there in the end.

Relief