inukshuk / jekyll-scholar

jekyll extensions for the blogging scholar
MIT License
1.12k stars 102 forks source link

Liquid Exception: undefined method `exists?' for File:Class in _pages/... #350

Closed pazz closed 1 year ago

pazz commented 1 year ago

Hi there!

I am building my website vie GitLab CI, using the "ruby:latest" docker image, and there seems to be a syntax error in this project's code? A long log with versions and trace is here but the relevant parts are below:

bundler: failed to load command: jekyll (/usr/local/bundle/bin/jekyll)
199/usr/local/bundle/gems/jekyll-scholar-7.1.1/lib/jekyll/scholar/utilities.rb:471:in `scholar_source': undefined method `exists?' for File:Class (NoMethodError)
200        return source if source.start_with?('/') && File.exists?(source)
201                                                        ^^^^^^^^
202Did you mean?  exist?
203 from /usr/local/bundle/gems/jekyll-scholar-7.1.1/lib/jekyll/scholar/utilities.rb:462:in `extend_path'
204 from /usr/local/bundle/gems/jekyll-scholar-7.1.1/lib/jekyll/scholar/utilities.rb:175:in `block in bibtex_paths'
205 from /usr/local/bundle/gems/jekyll-scholar-7.1.1/lib/jekyll/scholar/utilities.rb:173:in `map'
206 from /usr/local/bundle/gems/jekyll-scholar-7.1.1/lib/jekyll/scholar/utilities.rb:173:in `bibtex_paths'
207 from /usr/local/bundle/gems/jekyll-scholar-7.1.1/lib/jekyll/scholar/utilities.rb:842:in `update_dependency_tree'
208 from /usr/local/bundle/gems/jekyll-scholar-7.1.1/lib/jekyll/scholar/tags/bibliography_count.rb:19:in `render'
209 from /usr/local/bundle/gems/liquid-4.0.4/lib/liquid/block_body.rb:103:in `render_node_to_output'

It uses

 bundler 2.4.4
 jekyll 4.3.1
 jekyll-scholar 7.1.1

It is using ruby:latest, so I guess its on ruby v3.2.0.

Using Docker executor with image ruby:latest ...
Pulling docker image ruby:latest ...

Thanks for your help!

inukshuk commented 1 year ago

Thanks! We'll need to update the Gem. File.exists? used to be an alias of File.exist? that has been removed in newer Ruby versions.