Is the 'pathutil' ruby gem compatible with jekyll (v3.9.0) and ruby (v3.0.0)?
Asked Answered
F

4

7

My problem: I have a jekyll-based static website; after running bundle exec jekyll serve (as directed by the jekyll docs) I get the stack trace below. The markdown file I've created for that blog post file in the stack trace is entirely standard syntax. I've googled the specific error and get posts for similar errors that don't solve my problem. I've also scoured the jekyll docs to see if there are any incompatibilities with no luck.

           Writing: /home/REDACTED/projects/thomdlee.github.io/_site/jekyll/update/2020/12/28/currently-in-maintenance.html
                    done in 0.356 seconds.
jekyll 3.9.0 | Error:  no implicit conversion of Hash into Integer
/home/REDACTED/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/pathutil-0.16.2/lib/pathutil.rb:502:in `read': no implicit conversion of Hash into Integer (TypeError)
        from /home/REDACTED/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/pathutil-0.16.2/lib/pathutil.rb:502:in `read'

All my code can be found here on github: https://github.com/thomdlee/thomdlee.github.io

My environment:

  • Ubuntu 20.10 (running in WSL 2 on Windows 10)
  • Ruby v3.0.0
  • Jekyll (gem) v3.9.0
  • pathutil (gem) v0.16.2
Fendley answered 2/1, 2021 at 12:55 Comment(2)
I hit the same problem you did, same platform and WSL2. I’m nervous to say I have an answer as I just entirely purged my ruby configuration. However, using rbenv, I’m using Ruby 2.7.2, and Jekyll 4.2.0 by updating the Gemfile. Performance is MUCH better now, too. Try downgrading Ruby and upgrading Jekyll?Pharmacognosy
so for now basically the answer is noDeimos
M
3

It seems pathutil have an issue with deprecation Link

I had a same issue, but downgrading Ruby to 2.7.x solve this.

Micrography answered 13/3, 2021 at 3:3 Comment(1)
for arch user see rvm.Deimos
R
1

From this answer:

Ruby 3.0 deprecated using the last argument as keyword parameters. A double splat ** has to be added before the variable for the behavior to be supported.

Here's how I applied the patch to pathutil:

sudo sed -i.bak 's/, kwd/, **kwd/' $(gem which pathutil)
Reborn answered 30/9, 2022 at 13:56 Comment(0)
C
0

Only solution still is to downgrade.

On Arch Linux you can do

sudo pacman -S ruby2.7
cd /PATH/TO/YOUR/JEKYLL/PROJECT
bundle-2.7 install
bundle-2.7 exec jekyll serve

Source: https://bbs.archlinux.org/viewtopic.php?id=265534

Creature answered 19/10, 2021 at 21:13 Comment(0)
C
-1

I had the same issue but in MacOS environment.

To fix it I've ran the following command on the project folder:

bundler update

Climatology answered 3/3, 2021 at 15:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.