The Gemfile.lock file basically serves the same purpose as Python's requirements.txt file (freezing the versions of various dependencies), and is autogenerated when Jekyll's bundler is run locally.
However, GitHub Pages does not use a repo's Gemfile.lock when building. Given that we maintain and deploy this site largely through edits on GitHub, I don't think we actually need to maintain a Gemfile.lock here.
(There is a stalled effort to add a specific Gitignore template for GH Pages sites here: https://github.com/github/gitignore/pull/3690, which echoes the idea of adding Gemfile.lock to a GH Pages site's .gitignore.)
From https://github.com/spinalcordmri/spinalcordmri.github.io/pull/76#issuecomment-1723658878: