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

Add webrick as a dependency #8524

Merged
merged 4 commits into from Jan 10, 2021
Merged

Conversation

argilo
Copy link
Contributor

@argilo argilo commented Dec 25, 2020

This is a 🐛 bug fix.

Summary

As of Ruby 3.0, WEBrick is no longer bundled with Ruby, so it needs to be listed as a dependency of Jekyll.

Context

Fixes #8523

@argilo
Copy link
Contributor Author

argilo commented Dec 26, 2020

CI fails on JRuby 9.2.11.1 due to the following error:

ERROR TypeError: no implicit conversion of nil into Integer
	org/jruby/RubyIO.java:4239:in `copy_stream'
	/home/argilo/.gem/jruby/2.5.7/gems/webrick-1.7.0/lib/webrick/httpresponse.rb:479:in `send_body_io'
	/home/argilo/.gem/jruby/2.5.7/gems/webrick-1.7.0/lib/webrick/httpresponse.rb:358:in `send_body'
	/home/argilo/.gem/jruby/2.5.7/gems/webrick-1.7.0/lib/webrick/httpresponse.rb:227:in `send_response'
	/home/argilo/.gem/jruby/2.5.7/gems/webrick-1.7.0/lib/webrick/httpserver.rb:112:in `run'
	/home/argilo/.gem/jruby/2.5.7/gems/webrick-1.7.0/lib/webrick/server.rb:310:in `block in start_thread'

It appears this is due to a bug in JRuby, which was fixed in 9.2.12.0: jruby/jruby@f7e110b

I've updated CI to use a more recent JRuby and it now passes.

@argilo
Copy link
Contributor Author

argilo commented Dec 26, 2020

I also added Ruby 3.0 to CI. Some tests were failing because keyword arguments were not separated in TestGeneratedSite's setup method, so I fixed that as well.

Copy link
Member

@DirtyF DirtyF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the quick fix @argilo 🙏🏻

@DirtyF DirtyF added this to the 4.2.1 milestone Dec 31, 2020
@DirtyF DirtyF added the fix label Dec 31, 2020
Floppy added a commit to Floppy/cv that referenced this pull request Jan 8, 2021
@DirtyF
Copy link
Member

DirtyF commented Jan 10, 2021

@jekyll: merge +fix

@jekyllbot jekyllbot merged commit 5c797ba into jekyll:master Jan 10, 2021
@jekyllbot jekyllbot added the bug label Jan 10, 2021
jekyllbot added a commit that referenced this pull request Jan 10, 2021
github-actions bot pushed a commit that referenced this pull request Jan 10, 2021
Clayton Smith: Add webrick as a dependency (#8524)

Merge pull request 8524
github-actions bot pushed a commit to tigefa4u/jekyll that referenced this pull request Jan 10, 2021
jekyllbot: Update history to reflect merge of jekyll#8524 [ci skip]
github-actions bot pushed a commit to patilswapnilv/jekyll that referenced this pull request Jan 11, 2021
jekyllbot: Update history to reflect merge of jekyll#8524 [ci skip]
github-actions bot pushed a commit to chauncey-garrett/jekyll that referenced this pull request Jan 11, 2021
jekyllbot: Update history to reflect merge of jekyll#8524 [ci skip]
yous added a commit to yous/yous.be that referenced this pull request Mar 3, 2021
@nickmccurdy
Copy link

Can we please get a patch release of Jekyll 4 with this fix?

datenreisender added a commit to NordicSemiconductor/pc-nrfconnect-docs that referenced this pull request Jul 9, 2021
Ruby 3 does not bundle webrick anymore. This was fixed for jeckyll in
jekyll/jekyll#8524 but that is not released yet
and the github-pages gem depends on the old jekyll 3.9.0 anyhow. So for
now we need to add webrick to the dependencies ourselves.
@gingerbeardman
Copy link

I was banging my head against this problem yesterday.

This should be merged by now, if Jekyll releases are to be kept compatible with the latest ruby releases.

@argilo argilo deleted the add-webrick-dependency branch November 22, 2021 12:46
joelhawksley added a commit to ViewComponent/view_component that referenced this pull request Dec 16, 2021
* Add the WEBrick gem to the docs app

Since WEBrick is no longer bundled with Ruby in 3.0, and Jekyll depends on
WEBrick, the webrick gem needs to be added as a dependency to the docs
application in order to run `bundle exec jekyll serve` with Ruby 3.0+.

WEBrick has been added to a dependency of Jekyll on main in
jekyll/jekyll#8524, but the change hasn't yet made it
into a release.

* Update docs/Gemfile.lock

Co-authored-by: Joel Hawksley <joelhawksley@github.com>
@waldyrious
Copy link

waldyrious commented Oct 20, 2022

Can we please get a patch release of Jekyll 4 with this fix?

Just in case someone missed it, this change has finally (after almost 2 years!) been included in a release: https://github.com/jekyll/jekyll/releases/tag/v4.3.0

@audetcameron
Copy link

audetcameron commented May 31, 2023

how do you add webrick as a gem dependency on a mac using docker? Am I missing something? I'm not sure my gemfile is getting pulled over.

I run my docker container like so: Where it just pulls the /docs files in but I cant tell where it would pull in a ./root gemfile into the container. Any help is appreciated, thanks in advance.

jekyll:
	@echo "$(shell pwd)/docs:/srv/jekyll"
	docker run --rm \
  --volume="$(shell pwd)/docs:/srv/jekyll" \
  -p 4000:4000 \
  -it jekyll/jekyll:$(JEKYLL_VERSION) \
 	jekyll serve --force_polling --incremental

Also should we note that the /pages docker container should match the actual pages deps.
https://pages.github.com/versions/
They are still on ruby 2.7.4 and jekyll 3.9.3

HyukjinKwon pushed a commit to apache/spark that referenced this pull request Jan 11, 2024
### What changes were proposed in this pull request?

As [promised here][1], this change loosens our Ruby dependency specification so that Bundler can update transitive dependencies more easily.

Other changes included:
- Remove the direct dependency on webrick, because Jekyll [fixed the problem][2] that caused us to add it in the first place.
- Add explanatory comments to parts of the document generation process that are not obvious.

[1]: #44628 (comment)
[2]: jekyll/jekyll#8524

We can still build our docs using Ruby 2.7, but we should push devs to install Ruby 3 since Ruby 2 is [EOL][3] and we are unable to upgrade some of our doc dependencies until we're running Ruby 3.

[3]: https://www.ruby-lang.org/en/news/2022/04/12/ruby-2-7-6-released/

### Why are the changes needed?

Make the document building process more robust to future updates coming from the Ruby ecosystem.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

I built and reviewed the docs on both Ruby 2.7.8 and Ruby 3.3.0 using the following command:

```sh
SKIP_SCALADOC=1 SKIP_PYTHONDOC=1 SKIP_RDOC=1 bundle exec jekyll build
```

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #44667 from nchammas/SPARK-46658-ruby-deps.

Authored-by: Nicholas Chammas <nicholas.chammas@gmail.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jekyll serve fails on Ruby 3.0
9 participants