Error message "Your lockfile is unreadable"

I am a user of Jekyll 4.2.0 using theme 'just-the-docs" 0.3.3 under Windows 10 (my laptop). The completed website will be hosted in

I was trying to write a procedure for me and my colleagues could create a Jekyll site with just-the-docs from scratch with no errors in the bundle update.

I edited my Gemfile.lock file and made changed the rouge entry (the main one, not a subordinate one) to this value:
rouge (>= 1.7, < 4)

Why? I thought I was being helpful - let it decide which version it likes. I had read on a website that I now forget that the rouge version might have been an issue for me.
Unfortunately, when I ran “bundle update” I got this error message:

“Your lockfile is unreadable. Run ‘rm Gemfile.lock’ and then ‘bundle install’ to generate a new lockfile.”

The file Gemfile.lock of course was still perfectly readable.

It took me many hours, but I finally worked out this error message really means “Syntax error” or something like that.

I changed the entry in my Gemfile.lock file to this:
rouge (~> 3.0)

Suddenly, the Gemfile.lock is readable and the bundle update worked fine. I decided that rouge was not an issue for me, and it had all been unnecessary.

My reason for raising this issue is to ask - could someone change this error message so it says “Syntax error in Gemfile.lock - line xxx”? Is this a sensible question to ask (say at the Jekyll repo on I want to check here first in case this is a known problem.

The error wording I suggested would be much more helpful and would have saved me many hours of time.

As I understand it: you never change Gemfile.lock, only Gemfile, and Gemfile.lock will be produced automatically. In fact, if you delete Gemfile.lock it will reappear upon invoking jekyll.

1 Like

Thank you Michael ! This is exactly the advice a newbie like me needs. I had misinterpreted some bundle update messages thinking I needed to change Gemfile.lock. I shall cooperate with the system a lot better now !

1 Like

Am glad to hear it. Please mark it as “solution”.

1 Like

I think I have ticked “Solution” in the right place. The help I have received is a great advertisement for this site - very impressive.

1 Like

Jekyll doesn’t create the file. Installing with Bundler does.

But yes the file is easy to delete and recreate esp if things go awry

Thanks to you I am finally getting my head around it all. The file Gemfile.lock is basically not my problem - the bundler creates it and reads it and I don’t need to worry. I don’t even look at it now.
Things are going much more smoothly since I learned I only need to worry about two important files: Gemfile and _config.yml. I am becoming much more of a Jekyll fan now.

From Michael to Michael:
Thank you! I stand corrected, always learning.
I usually run Jekyll via a makefile, and indeed the pertinent line reads
JEKYLL_ENV=production bundle exec jekyll build,
so bundler is always involved.

1 Like