Foojay Today

Running Jekyll on a Mac

June 06, 2022

At the beginning of the year, I had two new Macs in a row in one month. I changed my company and had to return my previous laptop. Thus, I ordered a replacement one, but due to the current hardware shortage, the shipping took weeks: I had to rent one in the meanwhile.

It means I had to install my Jekyll stack twice in a row. The first time took quite some time; the second one was much faster.

In this post, I'd like to write it down once and for all to help other developers who want to do the same and my future self.

A new Mac OS system comes with an already installed Ruby distribution. Unfortunately, you cannot upgrade it. On my Mac, at the time of this writing, it's 2.6.8p205 (2021-07-07 revision 67951).

The first step is to install a more modern version. For this, we need first to install rbenv:

Use rbenv to pick a Ruby version for your application and guarantee that your development environment matches production. Put rbenv to work with Bundler for painless Ruby upgrades and bulletproof deployments. --

Note. The following relies on Homebrew, the command-line package manager for Mac OS. That's the first thing I install when I acquire a new one.

brew install rbenv

Next, we have to initialize our shell. For that, let's update our shell profile:

eval "$(rbenv init - zsh)"

I'm using the default Z-shell. If you're using another shell, locate its profile.

Then, we need to execute the profile in the current Terminal window:

. ~/.zshrc

At this point, we should list all available Ruby distributions:

rbenv install --list

The output should be similar to the following:


Let's install the latest "standard" version:

rbenv install 3.1.1

We can now use this version. Go to your Jekyll folder and type:

rbenv local 3.1.1

I manage the dependencies of my Jekyll blog with Bundler. Bundler is a Gem like all others:

gem install bundler

Dependencies are written in my Gemfile. We can execute bundler to install them:

bundle install

At this stage, a standard Jekyll blog should work. Yet, my blog also uses Asciidoctor, and more importantly, asciidoctor-diagram. I draw my diagrams using the PlantUML syntax. PlantUML requires a JVM and graphviz.

For the JVM, you can either install a dedicated one or install JRuby instead of a simple Ruby distribution. graphviz requires a dedicated executable:

brew install graphviz

Et voilà !

If I had to follow these steps more frequently than this, I'd probably automate it further.

To go further:

Originally published at A Java Geek on June 5th, 2022


Related Articles

View All
  • 5 Tips to Create Secure Docker Images for Java Applications

    Docker is the most widely used way to containerize your application. With Docker Hub, it is easy to create and pull pre-created images. This is very convenient as you can use these images from Docker Hub to quickly build an image for your Java application.

    However, the naive way of creating custom Docker images for your Java applications comes with many security concerns. So, how do we make security an essential part of Docker images for Java?

    Read More
    Dec 25, 2020
  • Are Java Security Updates Important?

    Recently, I was in discussion with a Java user at a bank about the possibilities of using Azul Platform Core to run a range of applications. 

    Security is a very serious concern when sensitive data is in use, and potentially huge sums of money could be stolen.

    I was, therefore, somewhat taken aback when the user said, “We’re not worried about installing Java updates as our core banking services are behind a firewall.”

    Read More
    Aug 03, 2021
  • Beginning JavaFX Applications with IntelliJ IDE

    This article is for the beginner who wants to get started developing JavaFX applications using IntelliJ IDE.

    While this article may seem elementary for some, I believe it can help newcomers to the JavaFX platform avoid some pitfalls and really hit the ground running.

    Read More
    Apr 28, 2021


  • Nicolas Frankel

    Nicolas is a developer advocate with 15+ years experience consulting for many different customers, in a wide range of contexts (such as telecoms, banking, insurances, large retail and public sector). ... Learn more

Comments (0)

Your email address will not be published.

Highlight your code snippets using [code lang="language name"] shortcode. Just insert your code between opening and closing tag: [code lang="java"] code [/code]. Or specify another language.

Save my name, email, and website in this browser for the next time I comment.

Subscribe to foojay updates:
Copied to the clipboard