jekyll: [Bug]: Error: undefined method `excerpt_separator' for #
Operating System
Ubuntu 22.04.3
Ruby Version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
Jekyll Version
jekyll 3.9.4
GitHub Pages Version
github-pages 229
Expected Behavior
I expected my site to be built successfully when I run the following:
bundle exec jekyll build --safe
Current Behavior
I get an error when I have an excerpt in a page: https://github.com/remarkablemark/remarkablemark.github.io/pull/71
jekyll 3.9.4 | Error: undefined method `excerpt_separator' for #<Jekyll::Page>
Relevant log output
Run bundle exec jekyll build --safe
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Configuration file: /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/_config.yml
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
Source: /home/runner/work/remarkablemark.github.io/remarkablemark.github.io
Destination: /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
jekyll 3.9.4 | Error: undefined method `excerpt_separator' for #<Jekyll::Page @name="404.md">
head, _, tail = doc_content.to_s.partition(doc.excerpt_separator)
^^^^^^^^^^^^^^^^^^
/home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/excerpt.rb:135:in `extract_excerpt': undefined method `excerpt_separator' for #<Jekyll::Page @name="404.md"> (NoMethodError)
head, _, tail = doc_content.to_s.partition(doc.excerpt_separator)
^^^^^^^^^^^^^^^^^^
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/excerpt.rb:25:in `initialize'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:173:in `new'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:173:in `replace_relative_links_excerpt!'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:[6](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:7)4:in `replace_relative_links!'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-relative-links-0.[7](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:8).0/lib/jekyll-relative-links/generator.rb:44:in `block in generate'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:39:in `each'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:39:in `generate'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:175:in `block in generate'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:173:in `each'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:173:in `generate'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:70:in `process'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/command.rb:2[8](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:9):in `process_site'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.[9](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:10).4/lib/jekyll/commands/build.rb:65:in `build'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/commands/build.rb:36:in `process'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/exe/jekyll:15:in `<top (required)>'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/bin/jekyll:25:in `load'
from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/bin/jekyll:25:in `<top (required)>'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:[12](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:13)7:in `invoke_command'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:1[23](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:24):in `with_friendly_errors'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/bin/bundle:[25](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:26):in `load'
from /opt/hostedtoolcache/Ruby/3.1.2/x64/bin/bundle:25:in `<main>'
Error: Process completed with exit code 1.
Code Sample
Steps to reproduce issue
Clone repository:
git clone https://github.com/remarkablemark/remarkablemark.github.io.git
cd remarkablemark.github.io
Checkout branch:
git checkout jekyll-error-undefined-method-excerpt_separator
Build site:
bundle exec jekyll build --safe
See https://github.com/remarkablemark/remarkablemark.github.io/pull/71
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 36 (4 by maintainers)
Commits related to this issue
- cicd: Add github workflows yml file to fix issue https://github.com/jekyll/jekyll/issues/9544 — committed to vince-lam/vince-lam.github.io by vince-lam 3 years ago
- Update discoveries.md for Jekyll bug with excerpt frontmatter tag There's a bug in Jekyll version 3.9.4 (recently released), something to do with the Excerpt tag in the frontmatter (metadata). Acc... — committed to HiltonTod/HiltonTod.github.io by HiltonTod 3 years ago
- Update kimber.md - remove excerpt tag from frontmatter There's a bug in Jekyll version 3.9.4 (recently released), something to do with the Excerpt tag in the frontmatter (metadata). According to t... — committed to HiltonTod/HiltonTod.github.io by HiltonTod 3 years ago
- Update reads.md for Jekyll bug with excerpt frontmatter tag There's a bug in Jekyll version 3.9.4 (recently released), something to do with the Excerpt tag in the frontmatter (metadata). According... — committed to HiltonTod/HiltonTod.github.io by HiltonTod 3 years ago
- Update technicalwriting.md for Jekyll bug with excerpt frontmatter tag Bug details: jekyll/jekyll#9544 Workaround: academicpages/academicpages.github.io#1878 — committed to HiltonTod/HiltonTod.github.io by HiltonTod 3 years ago
- Update words.md for Jekyll bug with excerpt frontmatter tag Bug details: jekyll/jekyll#9544 Workaround: academicpages/academicpages.github.io#1878 — committed to HiltonTod/HiltonTod.github.io by HiltonTod 3 years ago
- https://github.com/jekyll/jekyll/issues/9544 bug fix. — committed to peterica/peterica.github.io by peterica 3 years ago
- https://github.com/jekyll/jekyll/issues/9544 bug fix — committed to peterica/peterica.github.io by peterica 3 years ago
- Revert "cicd: Add github workflows yml file to fix issue https://github.com/jekyll/jekyll/issues/9544" This reverts commit d7331efc54659c0462156d1beb617acb2983e707. — committed to vince-lam/vince-lam.github.io by vince-lam 3 years ago
- fix: Remove excerpt tags in markdown files due to https://github.com/jekyll/jekyll/issues/9544 — committed to vince-lam/vince-lam.github.io by vince-lam 3 years ago
- [chore] temporarily disable excerpts to allow build github-pages 229 has an undefined method 'excerpt_separator'. the current site is on a legacy/default github pages workflow and not on a custom git... — committed to leewc/leewc.github.io by leewc 3 years ago
- update workflow to jekyll In response to Jekyll build error, added Jekyll.yml workflow following advice from QuantKang in https://github.com/jekyll/jekyll/issues/9544 — committed to jpmarken/jpmarken.github.io by jpmarken 3 years ago
- Removed excerpt lines Removed excerpt lines from 404.md, about.md, and non-menu-page.md following advice on https://github.com/jekyll/jekyll/issues/9544 from marksherriff. — committed to jpmarken/jpmarken.github.io by jpmarken 3 years ago
- removed excerpt: https://github.com/jekyll/jekyll/issues/9544 — committed to Lavenderjiang/lavenderjiang.github.io by Lavenderjiang 3 years ago
- Update from "https://github.com/jekyll/jekyll/issues/9544" — committed to OPTML-Group/OPTML-Group.github.io by ljcc0930 3 years ago
For those having this issue specifically with the academicpages template (evidenced potentially by specifically the 404.md file error), it turns out if you remove the excerpt line from 404.md, about.md, and non-menu-page.md, everything deploys properly.
https://github.com/academicpages/academicpages.github.io/issues/1878
Also running into this on gh pages, where you cannot specify the Jekyll version
Second time a charm?
We sent
pages-gemv231 everywhere. It reverted (for now)jekyll-relative-linksto the previous release. Hopefully that clears up all the issues.Let us know!
@parkr @yoannchaudet I hate to be a pain, but 3.9.5 is broken for me with a new error:
That error is from the Github pages build, and I see the same error locally with 3.9.5 on multiple sites. I don’t think that’s an issue with my setup, but for completeness, here is what those files look like for me:
/_layouts/empty.html is my basic layout, it has no front-matter
dpa.md is a regular page in my site. Here is the start of the file
If you build your site with Actions (which is the majority of cases), your build should be fixed now. The change made it in https://github.com/actions/jekyll-build-pages/releases/tag/v1.0.11.
Still deploying the changes to Pages’ legacy infrastructure now.
Thanks @parkr for patching Jekyll for us ❤ and sorry for all the troubles.
The root cause appears to be https://github.com/benbalter/jekyll-relative-links/pull/65. It’s using Jekyll::Excerpt with a Jekyll::Page which is not compatible. (It must be used with a Jekyll::Document.)
I am proposing a fix for Jekyll 3.9 in #9550. This will allow Excerpts to be created for Page objects, which I think is best.
after hours of debugging I was able to fix it - https://github.com/ayrat555/ayrat555.github.io/commit/eae9cdc2ae20b5755b68995f5ec1dd8ac54e941a
I added a custom workflow suggested in https://github.com/jekyll/jekyll/issues/9544#issuecomment-1936982361
had to modify gem and config files
also, had to modify the source of the github pages in config
Yes, sure, but I’m just talking about the built in gh pages functionality. I don’t want to have to reconfigure the whole site because there appears to be an issue in one version of Jekyll.
Pinning the
github-pagesversion does not appear to work, the builder uses the versions it wants regardless with the message:I think the gem is meant for easily replicating the builder environment on your local machine rather than telling the builder what to use.
@AndrewWPhillips 2 lines in _config.yml:
I also had to override some layouts and includes in the Minimal Mistakes theme I am using so that the rendering is OK for the splash layout (it uses the excerpt keyword, which I had to replace: commit here).
I think I found an easy way of using the previous release of
pages-build-deploymentworkflow.ActionmenuNew workflowbuttonGitHub Pages Jekyll(notJekyll) and click Configure buttonfrom:
to:
GitHub Pages Jekyllandpages-build-deploymentare essentially same. The main difference of them is an additionalreport-build-statusstage inpages-build-deployment.You can find more information about 'GitHub Pages Jekyll` workflow at https://github.com/actions/jekyll-build-pages/pkgs/container/jekyll-build-pages
Also, even if you’re still using the github-pages gem, you can specify the Jekyll version by specifying the github-pages gem version. For example, if you set the gem to version 228, it will use Jekyll 3.9.3: https://rubygems.org/gems/github-pages/versions/228
You can pin the version like this in your Gemfile:
I had the same issue. But I got it to work by rolling back to Jekyll 3.9.3.
Thanks @yoannchaudet! I can confirm that this fixed the issue for me: https://github.com/remarkablemark/remarkablemark.github.io/pull/71
(aside) I totally get “you should just use a GH Pages Action like so…” But the popularity - and simplicity! - of GH Pages “just working out of the box” is huge, and it was disappointing (on GH’s part, really, not your’s!) that this now suddenly is breaking deploys to GHPages sites people thought were zero maintenance.
In any case, thanks Jekyll peeps for building and maintaining such an awesome system! 🥰
I’ve spent a few hours debugging this as I have several sites hosted on Github pages that are all unable to deploy. Here’s what I have found based on diving into a lot of the other comments.
GitHub Pages builds are failing with an error like this:
The file referenced is any Markdown file with a excerpt specified, which we do on lots and lots of files. This error starts in Jekyll 3.9.4, and I see it locally as well. Jekyll 3.9.3 works file. Seems like a bug that should be rolled back by Jekyll.
On Friday, Feb 9th, Github released a change to it’s GitHub Pages default action that updates the github-pages gem to version 229. The main thing that 229 does is upgrade Jekyll to 3.9.4. Boom, broken.
Unfortunately, it doesn’t seem like it’s easy to override this. Specifying
gem "github-pages", "=228"in your own gemfile gets you this message:Warning: The github-pages gem can't satisfy your Gemfile's dependencies. If you want to use a different Jekyll version or need additional dependencies, consider building Jekyll site with GitHub Actions: https://jekyllrb.com/docs/continuous-integration/github-actions/I opened a bug with Github Actions as this seems like something we should be able to control and override.
The workaround that @QuantKang left works for me, but I don’t like switching all my repos to custom actions just to point at an old version. I feel like this is going to be fixed in the next few days, so I’m not running to update all my pages repositories just yet.
Hopefully this helps the next person that comes looking for why their GitHub Pages are busted right now.
If you were using GitHub Pages as the build and deployment source, you should do the following. If not, your changes will be accepted successfully, but you will run into errors because the site would still technically be configured to use GitHub pages.
Deploy from a BranchtoGitHub ActionsI hope this helps someone 😃
I encountered the same issue. It seems an excerpt separator is now required for every excerpt, so I just defined one in my _config.yml file and added it at the end of every excerpt. The build is now OK with jekyll 3.9.4
A simple way to work around this issue is defining a new workflow by copying
Jekyllworkflow:ActionmenuNew workflowbuttonJekyllJekylland clickConfigurebuttonCommit changesYou may need to
pullandpushfrom your local repository to sync with the commit.The workflow seems designed for the latest stable Jekyll. It uses Jekyll 4.3.3.
Thanks to @SatyajithBoyana suggestion I was able to fix this. Also mentioned in https://talk.jekyllrb.com/t/local-windows-dev-environment-for-github-pages-theme/8938
See https://github.com/dieghernan/chulapa/commit/f508ba108892ddd2ca1dd5aa4da0d723662a23e7