Friedrich Ewald My Personal Website

Updating Jekyll to Ruby 3.2.0

I recently updated this blog to Ruby 3.2.0 which was released on Dec 25, 2022. I expected this to be a minor update since I came from Ruby 3.1.2. However, I ran into some problems that I had to solve.

Outdated API

It turns out that there is one important change in the Ruby standard library. File.exists? was renamed to File.exist? with the same functionality. Some third-party plugins that I use have not yet included this change. I was able to extend the File class like so:
class File
  def self.exists?(*args)
I added this file as in the _plugins folder so that Jekyll would import it automatically.

Updating Jekyll

The version of Jekyll that I used was not compatible with Ruby 3.2.0. I had to update my Gemfile to the following and then run bundle update. This will apply updates to Jekyll automatically in the future.
# ...
ruby "3.2.0"
# ...
gem "jekyll", "~> 4"

SASS Compiler

With the Jekyll update came also an update to the SASS compiler. My css folder contains one file: main.scss. This file has just some import statements that it uses to assemble a larger CSS file. I got an error message that instead of the ; at the end of each line, curly braces are expected. I spent quite some time to try to figure out what is going on, until I saw the changelog on the Jekyll homepage. It turns out that the main.scss cannot have the same name as the imported _main.scss. After renaming it to _base.scss, it worked. See the last line in the snippet below for an example.
# Front matter is needed here
@charset "utf-8";

@use "syntax";
@use "poole";
@use "lanyon";
@use "base";
After those steps, everything worked again and this site is now generated with Ruby 3.2.0!

About the author

is an experienced Software Engineer with a Master's degree in Computer Science. He started this website in late 2015, mostly as a digital business card. He is interested in Go, Python, Ruby, SQL- and NoSQL-databases, machine learning and AI and is experienced in building scalable, distributed systems and micro-services at multiple larger and smaller companies.