Journey to Jekyll: Part 9 - Upgrading to Ruby 2.6

I have used Jekyll since Christmas 2016 and have never updated it since it worked fine for me. Just over a year ago, I tried to update to Ruby 2.7 when it was brand new and ran into a few errors and backed off for a while. In fact, I have been running Ruby 2.2 on my computer only for my Jekyll site. Finally, I decided to move up to Ruby 2.6 at least.

I ran into a few minor things and wanted to document them here.

Background on my installation

My setup was basically inherited from a theme that I liked and it used the following in the Gemfile:

  • gem ‘github-pages’
  • gem ‘jekyll-textile-converter’
  • gem ‘wdm’, ‘>= 0.1.0’ if Gem.win_platform?

I also added jekyll-admin though I never used it.

My setup was not really complicated and was running fine on Ruby 2.2.

Upgrading the Site

Making sure that I had a backup (in my case, the whole site is in a Git repository and I created a branch to do the update), I got started. I tried to do a bundle install but Ruby 2.6 complained that the Bundler version was not installed, and I could either update it to use the latest bundler on my system ($ bundle update --bundler) or I could install the older gem instead.

I decided to follow the unstated Option 3 – delete Gemfile.lock and do a fresh bundle install to let it find the latest versions by itself.

This worked – it installed a lot of gems and succeeded. There were a few post-installation notes but none that were an immediate problem.

Installing dnsruby...
  For issues and source code:
  For general discussion (please tell us how you use dnsruby):!forum/dnsruby
Post-install message from sass:

Ruby Sass has reached end-of-life and should no longer be used.

* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
  primary implementation:

* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
  sassc gem:

* For more details, please refer to the Sass blog:

Post-install message from html-pipeline:
Thank you for installing html-pipeline!
You must bundle Filter gem dependencies.
See html-pipeline for more details.

The second one (End-of-life for Ruby Sass) is probably a bit of an issue but it won’t stop us for now – so, we go on.

Let’s hit Play!

We optimistically start jekyll:

bundle exec jekyll serve 

We get a couple of messages (we’ll look at that in a moment) but we are hit with a wall of red!

OK, this is not a problem – we expected this. I use Textile markup that uses the RedCloth gem that has a problem on Windows and needs a minor change. If you don’t use Textile, you won’t see this. If you do, you need to follow the notes on this issue at GitHub to resolve it.

Once done, we can breathe and start again. Actually, everything works… no, really!

Handling the Other Minor Issues

Let’s look at the other things that were shown before the wall of red:

Doing `require 'backports'` is deprecated and will not load any backport in the next major release.
Require just the needed backports instead, or 'backports/latest'.
Configuration file: D:/projects/blog/jekyll/onghu-uno/_config.yml
       Deprecation: The 'gems' configuration option has been renamed to 'plugins'. Please update your config file accordingly.

There are 2 minor issues:

  • Changing the word gems in _config.yml to plugins – this is easily done and please just do it. Once you restart Jekyll serve, that warning will go away.
  • Then, the backports deprecation – where does that come from?

It’s natural to assume that it came from jekyll and so I did a search for it online and landed on a GitHub issue that reported the same observation where I also added my details. However, while investigating a bit further, I realised that the issue is not from Jekyll. The issue comes because my Gemfile is including jekyll-admin and it depends on sinatra-contrib:

jekyll-admin (0.11.0)
      jekyll (>= 3.7, < 5.0)
      sinatra (~> 1.4)
      sinatra-contrib (~> 1.4)

and sinatra-contrib has a dependency on backports:

sinatra-contrib (1.4.7)
      backports (>= 2.0)
      sinatra (~> 1.4.0)
      tilt (>= 1.3, < 3)

Long story short – remove jekyll-admin first (which I don’t even use yet) and regular jekyll is perfectly fine. No more warnings!

So, that’s all there is to it for now. The site works fine on my new setup now:

  • Ruby 2.6.6 on Windows
  • Jekyll 3.9.0 (it’s fixed to this because my site works off the github-pages gem which currently mandates this version)
  • RedCloth 4.3.2

No warnings, no deprecations, no failures, no red wall of code!

This page is here mostly to remind me of what I did in case I run into it again. If it helps someone else, then that’s great. If you have any comments, please do leave them below so that I can have a look and update the page based on what I learn.

comments powered by Disqus