Skip to content

pathutil issue breaks build on ruby3 #11

Description

@7yl4r

when running bundle exec jekyll serve:

jekyll 3.9.0 | Error:  no implicit conversion of Hash into Integer
/usr/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 /usr/lib/ruby/gems/3.0.0/gems/pathutil-0.16.2/lib/pathutil.rb:502:in `read'
[...]
	from /home/tylar/.gem/ruby/2.7.0/bin/bundle:23:in `<main>'

Same problem on s.o..

This is a known open issue with pathutil [ref]. A fix was posted 2020-06 and hasn't been merged. 🤦


Many suggest downgrading to ruby 2.7. I tried doing this based on some random forum advice. I get the same error after the following:

sudo pacman -S ruby2.7
bundle-2.7 install
bundle-2.7 exec jekyll serve

NOTE: turns out that this didn't downgrade ruby.


This is curious:

[tylar@tylar-pc marinebon.github.io]$ bundle-2.7 --version
Bundler version 2.2.20
[tylar@tylar-pc marinebon.github.io]$ bundle --version
Bundler version 2.2.20

Seems conincidental though:

[tylar@tylar-pc marinebon.github.io]$ which bundle
/home/tylar/.gem/ruby/2.7.0/bin/bundle
[tylar@tylar-pc marinebon.github.io]$ which bundle-2.7
/usr/bin/bundle-2.7
[tylar@tylar-pc marinebon.github.io]$ ls -lh /home/tylar/.gem/ruby/2.7.0/bin/bundle
-rwxr-xr-x 1 tylar tylar 526 Jun 21 18:07 /home/tylar/.gem/ruby/2.7.0/bin/bundle
[tylar@tylar-pc marinebon.github.io]$ ls -lh /usr/bin/bundle-2.7
-rwxr-xr-x 1 root root 530 Jul  8 14:50 /usr/bin/bundle-2.7

Okay well let's try and actually use ruby 2.7 since that bundler thing doesn't do it. I'll do this using rvm.

# set up gpg keys so my pc will trust the rvm src code
[tylar@tylar-pc marinebon.github.io]$ gpg2 --keyserver keys.openpgp.org --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
gpg: key 105BD0E739499BDB: public key "Piotr Kuczynski <piotr.kuczynski@gmail.com>" imported
gpg: key 3804BB82D39DC0E3: no user ID
gpg: Total number processed: 2
gpg:               imported: 1

# install rvm
[tylar@tylar-pc marinebon.github.io]$ \curl -sSL https://get.rvm.io | bash -s stable
[tylar@tylar-pc marinebon.github.io]$ source /home/tylar/.rvm/scripts/rvm

# tell rvm to install ruby 2.7
[tylar@tylar-pc marinebon.github.io]$ rvm install 2.7

[tylar@tylar-pc marinebon.github.io]$ rvm use 2.7
Using /home/tylar/.rvm/gems/ruby-2.7.2

[tylar@tylar-pc marinebon.github.io]$ mv Gemfile.lock Gemfile.lock.backup
[tylar@tylar-pc marinebon.github.io]$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies.............................................
Using bundler 2.2.20
[...]

Yay! Now bundle exec jekyll serve works again.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions