Jekyll may not run on Arch Linux because of an error with webrick. This is caused because webrick is not yet compatible with latest version of Ruby (3.0.1).

This is the relevant line from error output.

/blog/vendor/bundle/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in require: cannot load such file – webrick (LoadError)

While setting up my GitHub pages blog, I faced this issue. I’ll quickly document how to fix this.

Install Bundle

You will need to have rubygems installed for this.

sudo pacman -S rubygems

Then install bundle via gem.

gem install bundle

Gem will print a warning about not having the local binary folder in your path. Add the following line to your ~/.bashrc or ~/.zshrc depending on the shell you use.

export PATH=/home/$USER/.local/share/gem/ruby/3.0.0/bin:$PATH

Make sure you replace “3.0.0” with the version number gem reports.

Uninstall Ruby

We need to remove the latest Ruby version.

sudo pacman -Rns ruby rubygems

Install Ruby 2.7

Webrick is compatible with Ruby 2.7. This is the version we will install.

sudo pacman -S ruby2.7

bundle will call the binary at /usr/bin/ruby. However, the old Ruby version is installed at /usr/bin/ruby-2.7. So we will create a symlink. You will need to uninstall ruby as I said earlier.

sudo ln -s /usr/bin/ruby-2.7 /usr/bin/ruby

Now, /usr/bin/ruby will just be a symlink (or shortcut in layman terms) to /usr/bin/ruby-2.7.

Run bundle

Go to your Jekyll project directory. Install the dependencies.

bundle install

Then launch your Jekyll site

bundle exec jekyll serve

Your website should be now live! 🚀

You can receive latest updates from this blog as an RSS feed. See Follow this blog via RSS.

Follow me on GitHub : flyingcakes85