Techioz Blog

racc/parser.rb の LoadError - ローカルの Jekyll Web サイトのビルドを妨げます

概要

数年前に Jekyll を使用して構築した静的 Web サイトを再訪問していますが、ソースをローカルでコンパイルして github ページ Web サイトに送信するのに問題があります。専門的には詳しくないので、以下の文中に間違いがあった場合はご容赦ください。

奇妙なワークフローの理由は、Jekyll-scholar および bibtex-ruby gem を使用する必要があるため、基本的にローカルでビルドしてから、コミットして github ページにデプロイする必要があります。 jekyll ビルドを停止する以下の問題が発生しています。

C:/Ruby33-x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `require': cannot load such file -- racc/parser.rb (LoadError)
        from C:/Ruby33-x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bibtex-ruby-6.0.0/lib/bibtex/name_parser.rb:7:in `<top (required)>'
        from C:/Ruby33-x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
        from C:/Ruby33-x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bibtex-ruby-6.0.0/lib/bibtex.rb:60:in `<top (required)>'
        from C:/Ruby33-x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
        from C:/Ruby33-x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-scholar-7.1.3/lib/jekyll/scholar.rb:6:in `<top (required)>'
        from C:/Ruby33-x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
        from C:/Ruby33-x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-scholar-7.1.3/lib/jekyll-scholar.rb:1:in `<top (required)>'
        from <internal:C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from C:/Ruby33-x64/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/runtime.rb:55:in `each'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/runtime.rb:55:in `block in require'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/runtime.rb:44:in `each'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/runtime.rb:44:in `require'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler.rb:187:in `require'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-4.3.3/lib/jekyll/plugin_manager.rb:53:in `require_from_bundler'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-4.3.3/exe/jekyll:11:in `<top (required)>'
        from C:/Ruby33-x64/bin/jekyll:32:in `load'
        from C:/Ruby33-x64/bin/jekyll:32:in `<main>'

明確にするために、GEM ファイルを含めます。

GEM
  remote: https://rubygems.org/
  specs:
    addressable (2.8.6)
      public_suffix (>= 2.0.2, < 6.0)
    bibtex-ruby (6.0.0)
      latex-decode (~> 0.0)
    citeproc (1.0.10)
      namae (~> 1.0)
    citeproc-ruby (1.1.14)
      citeproc (~> 1.0, >= 1.0.9)
      csl (~> 1.6)
    colorator (1.1.0)
    concurrent-ruby (1.2.2)
    csl (1.6.0)
      namae (~> 1.0)
      rexml
    csl-styles (1.0.1.11)
      csl (~> 1.0)
    em-websocket (0.5.3)
      eventmachine (>= 0.12.9)
      http_parser.rb (~> 0)
    eventmachine (1.2.7)
    ffi (1.16.3)
    forwardable-extended (2.6.0)
    google-protobuf (3.25.1)
    http_parser.rb (0.8.0)
    i18n (1.14.1)
      concurrent-ruby (~> 1.0)
    jekyll (4.3.3)
      addressable (~> 2.4)
      colorator (~> 1.0)
      em-websocket (~> 0.5)
      i18n (~> 1.0)
      jekyll-sass-converter (>= 2.0, < 4.0)
      jekyll-watch (~> 2.0)
      kramdown (~> 2.3, >= 2.3.1)
      kramdown-parser-gfm (~> 1.0)
      liquid (~> 4.0)
      mercenary (>= 0.3.6, < 0.5)
      pathutil (~> 0.9)
      rouge (>= 3.0, < 5.0)
      safe_yaml (~> 1.0)
      terminal-table (>= 1.8, < 4.0)
      webrick (~> 1.7)
    jekyll-sass-converter (3.0.0)
      sass-embedded (~> 1.54)
    jekyll-scholar (7.1.3)
      bibtex-ruby (~> 6.0)
      citeproc-ruby (~> 1.0)
      csl-styles (~> 1.0)
      jekyll (~> 4.0)
    jekyll-watch (2.2.1)
      listen (~> 3.0)
    json (2.7.1)
    kramdown (2.4.0)
      rexml
    kramdown-parser-gfm (1.1.0)
      kramdown (~> 2.0)
    latex-decode (0.4.0)
    liquid (4.0.4)
    listen (3.8.0)
      rb-fsevent (~> 0.10, >= 0.10.3)
      rb-inotify (~> 0.9, >= 0.9.10)
    mercenary (0.4.0)
    namae (1.1.1)
    pathutil (0.16.2)
      forwardable-extended (~> 2.6)
    public_suffix (5.0.4)
    rack (2.2.8)
    rackup (1.0.0)
      rack (< 3)
      webrick
    rb-fsevent (0.11.2)
    rb-inotify (0.10.1)
      ffi (~> 1.0)
    rexml (3.2.6)
    rouge (4.2.0)
    safe_yaml (1.0.5)
    sass-embedded (1.69.5-x64-mingw-ucrt)
      google-protobuf (~> 3.23)
    terminal-table (3.0.2)
      unicode-display_width (>= 1.1.1, < 3)
    unicode-display_width (2.5.0)
    webrick (1.8.1)

PLATFORMS
  x64-mingw-ucrt

DEPENDENCIES
  jekyll-scholar
  json
  rack (~> 2.0)
  rackup

BUNDLED WITH
   2.5.3

ご覧のとおり、私は Ruby 3.3.0 を使用しています - これを修正する方法についてのアドバイスをいただければ幸いです - 他のフォーラムを見ると、パーサーに権利の問題がある可能性があることがわかりましたが、修正方法がわかりませんそれを修正し、基本的に私にできること(極端な場合は何をコメントアウトするか)さえも、出力形式は非常に直感的ではありません。前もって感謝します!

関連する gem のバージョンをダウングレードしたり、フォーラムの投稿で提案された新しい gem を追加したりしましたが、すべて失敗しました。

jekyllrb トーク ページには関連する投稿がありませんでした。

解決策

Gemfile gem ‘racc’ を追加し、bundle install を実行すると、私の場合はこの問題が解決されました。