alshedivat / al-folio

A beautiful, simple, clean, and responsive Jekyll theme for academics
https://alshedivat.github.io/al-folio/
MIT License
11.19k stars 11.24k forks source link

Jekyll-Scholar and Al-Folio: undefined method `exists?' #1123

Closed sekarshre closed 1 year ago

sekarshre commented 1 year ago

Hello, (new user here)

I decided to create a new issue to reference the problem described in https://github.com/alshedivat/al-folio/issues/1116#issuecomment-1383387483 as this is a separate bug from what was originally mentioned in that thread.

In short, when I run bundle exec jekyll serve, I get the following error, which I suspect is due to jekyll-scholar not being able to compile the bibliography.

 Liquid Exception: undefined method `exists?' for File:Class in C:/Users/shrey/Documents/Website/al-folio-master/_layouts/about.html
                    ------------------------------------------------
      Jekyll 4.3.1   Please append `--trace` to the `serve` command
                     for any additional information or backtrace.
                    ------------------------------------------------
C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-scholar-7.1.1/lib/jekyll/scholar/utilities.rb:471:in `scholar_source': undefined method `exists?' for File:Class (NoMethodError)

        return source if source.start_with?('/') && File.exists?(source)
                                                        ^^^^^^^^
Did you mean?  exist?

Here's a few things I tried:

  1. I went into scholar/utilities.rb and tried changing exists?(name) ---> exist?(name). After this, I was able to run bundle exec jekyll serve without errors. Unfortunately, my bibliography did not compile and as a result, I wasn't able to get my publication page to load.

  2. To check if the problem was with jekyll-scholar, I tried running a different jekyll theme. But my bibliography seemed to compile okay there.

  3. Updated bundle, rubygems, and jekyll.

Other details: Windows computer.

I'm stuck now and I would really appreciate some help on dealing with this issue. Thanks a lot!

karynaur commented 1 year ago

same issue here

sekarshre commented 1 year ago

I was able to fix this by going into C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-scholar-7.1.1/lib/jekyll/scholar/utilities.rb and replacing all instances of File.exists? to File.exist? (I believe there are exactly 3 instances).