Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make serve fails on ruby 3.0 #37

Closed
slotThe opened this issue Aug 20, 2021 · 4 comments
Closed

make serve fails on ruby 3.0 #37

slotThe opened this issue Aug 20, 2021 · 4 comments

Comments

@slotThe
Copy link
Member

slotThe commented Aug 20, 2021

This is not an issue with this repo per se, but it is perhaps valuable to write it down somewhere so people can find this information.

With ruby 3.0, make serve fails with something like

TypeError: no implicit conversion of Hash into Integer

This seems to be caused by pathutil ignoring a deprecation which is now actually a compilation error.

Further, webrick seems to not be bundle anymore, which means it has to be added to the Gemfile.

How to fix it locally

  1. Manually apply the patch from Fix ruby keyword parameter deprecation warnings envygeeks/pathutil#5 to the pathutil dir:

    $ pwd
    /home/slot/repos/xmonad/xmonad-web/.bundle/xmonad-gems/ruby/3.0.0/gems/pathutil-0.16.2
    $ patch -p1 < diff.patch

    there might be some warnings about missing tests, but this can safely be ignored.

  2. As pointed out in Jekyll serve fails on Ruby 3.0 jekyll/jekyll#8523, add

    gem "webrick", "~> 1.7"

    to the gemfile or install webrick directly with bundle add webrick.

  3. make serve should now work.

liskin added a commit to liskin/xmonad-web that referenced this issue Mar 11, 2022
Ruby 3.0, which is now default in Debian (and likely many other
distros), isn't officially supported by the github/pages-gem and some of
its dependencies (despite patches being available for over a year—WTF),
so `make serve` doesn't work.

As a workaround, prefer Ruby 2.7 (the "bundle2.7" command) if available.

Related: xmonad#37
liskin added a commit to liskin/xmonad-web that referenced this issue Mar 13, 2022
Makefile: Prefer Ruby 2.7 if available

Ruby 3.0, which is now default in Debian (and likely many other
distros), isn't officially supported by the github/pages-gem and some of
its dependencies (despite patches being available for over a year—WTF),
so `make serve` doesn't work.

As a workaround, prefer Ruby 2.7 (the "bundle2.7" command on
Debian-based distros, "bundle-2.7" on Arch) if available.

Related: xmonad#37
liskin added a commit to liskin/xmonad-web that referenced this issue Mar 13, 2022
Ruby 3.0, which is now default in Debian (and likely many other
distros), isn't officially supported by the github/pages-gem and some of
its dependencies (despite patches being available for over a year—WTF),
so `make serve` doesn't work.

As a workaround, prefer Ruby 2.7 (the "bundle2.7" command on
Debian-based distros, "bundle-2.7" on Arch) if available.

Related: xmonad#37
liskin added a commit to liskin/work.lisk.in that referenced this issue Aug 29, 2022
Ruby 3.0, which is now default in Debian (and likely many other
distros), isn't officially supported by the github/pages-gem and some of
its dependencies (despite patches being available for over a year—WTF),
so `make serve` doesn't work.

As a workaround, prefer Ruby 2.7 (the "bundle2.7" command on
Debian-based distros, "bundle-2.7" on Arch) if available.

Related: xmonad/xmonad-web#37
@liskin
Copy link
Member

liskin commented Aug 30, 2022

Do we want to keep eb65e5d around?

@slotThe
Copy link
Member Author

slotThe commented Aug 30, 2022 via email

@liskin
Copy link
Member

liskin commented Sep 9, 2022

Absolutely no idea, but also: why is it important? Our Makefile now works with both 2.7 and 3.0, but still prefers 2.7, and we likely no longer need that preference.

@slotThe
Copy link
Member Author

slotThe commented Sep 9, 2022

Mh, you're probably right. Let's just revert that then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants