Github Pages fails build non-deterministically

I am deeply, deeply confused about everything going on.

I have a Github pages blog at GitHub - alexirpan/alexirpan.github.io: Repo backing personal website which has worked fine for years, but suddenly my local setup has started to fail. Most confusingly, the error messages are changing every run. Sometimes it segfaults, sometimes the error message is from kramdown, sometimes it’s from sass.

I originally thought I somehow polluted my local Ruby install, but I have tried redoing the Jekyll installation in a fresh Linux VM and see the same issues. I’ve had a bit of success using the Jekyll docker image but it doesn’t work reliably. I have tried uninstalling and reinstalling Ruby, Bundler, Jekyll, redoing things with RVM, just all sorts of things.

My best guess is that I have some version mismatch caused by an upstream update, and need to lock down a specific version in my Gemfile, but I don’t know where to get started on specifying that.

Here’s an example non-segfaulting paste

Here is a different error getting thrown in sass that’s showing up on a new attempt at a fresh install

I tried building the site, but I couldn’t reproduce the errors you observed. Some comments in case they are useful:

About locking down Gemfile versions: Because you’re using Github-Pages to build the site, you shouldn’t lock down any versions. Github regularly updated the Gitub-Pages gems, so you always want local builds to use the latest version (i.e. no versions in Gemfile, and regularly delete Gemfile.lock).

On the Docker issue, I’d recommend against using the official Jekyll image, because it is several years out of date. You can use a Ruby image. Here’s the somewhat long-winded command I used to run the site:

docker run -it --rm -p 4000:4000 ruby sh -c \
'git clone https://github.com/alexirpan/alexirpan.github.io.git ; cd alexirpan.github.io ; bundle install ; bundle exec jekyll serve --host 0.0.0.0'

I’m okay with locking down a Gemfile version for local dev, since I generally trust the Github Pages build to do the right thing. I’m looking for something that will let me locally build my site so that I look at drafts before pushing them to live, and would be willing to swap to a local Gemfile that I don’t check into Git if that works.

I tried the command you added and it is erroring for me with a similar Ruby errors within kramdown. What OS are you on? I’ve been trying to run this from WSL (Ubuntu on Windows 11)

Also tried running

docker run -it --rm -p 4000:4000 --volume="$PWD:/srv/jekyll" ruby sh -c 'cd /srv/jekyll; bundle install ; bundle exec jekyll serve --host 0.0.0.0'

in an Ubuntu VM, and after checking out the repo, it ran fine for me the first time, but future runs are giving me errors.

I’m running macOS 26 (arm64) and the Docker Ruby image is Debian 13 (aarch64). Both have Ruby 3.4.7. You might run docker pull ruby (or add --pull always to run command) to make sure you have an up-to-date image.

The run logs from my docker command look the same as yours, except for the error. It is strange, because we should be running the same clean Debian/Ruby/Gems/git-clone. The architectures are different (arm vs x86-64), but it would seem an unlikely cause of the error.