Jekyll build failing today, exact source built successfully yesterday

I was just hit by the same problem. The thing that I found suspicious was this:

Error: could not read file /opt/build/repo/cache/bundle/ruby/3.2.0/gems/jekyll-4.3.2/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb

Specifically, it says repo/cache/bundle, and doesn’t contain vendor like the default excluded paths.

The solution that worked for me was to uncomment the default exclusions in _config.yml and to add the cache/ path:

exclude:
  - Gemfile
  - Gemfile.lock
  - node_modules
  - vendor/bundle/
  - vendor/cache/
  - vendor/gems/
  - vendor/ruby/
  - cache/

I initially added more directories, but after a bit more exploration, adding cache/ seems to be sufficient.

4 Likes