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

Issue with github-pages gem with Ruby 3 #51

Open
evanwill opened this issue Jun 3, 2021 · 2 comments
Open

Issue with github-pages gem with Ruby 3 #51

evanwill opened this issue Jun 3, 2021 · 2 comments

Comments

@evanwill
Copy link
Contributor

evanwill commented Jun 3, 2021

Gemfile contained gem "github-pages" to keep in sync with github pages versions.
However, the gem only works with Ruby 2.7x and causes error with Ruby 3 when you bundle exec jekyll s.

To avoid issues, I changed the Gemfile to use our generic jekyll + webrick version, b303164
It should work for local development on Ruby 3 or 2 now.

Adding this issue in case anyone comes across the error using the original Gemfile.
Hopefully this is a temporary thing.

@danieljohnevans
Copy link

Can't seem to reproduce issue. No issue installing gem github-pages and running bundle exec jekyll serve

Running ruby 3.1.2p20 and jekyll 4.2.2

Possibly resolved?

@evanwill
Copy link
Contributor Author

I don't think it is resolved yet...
@danieljohnevans to reproduce the error in your CB-GH repository, in your "Gemfile", uncomment gem "github-pages" and comment out jekyll and webrick. So your Gemfile would look like:

gem "github-pages"
#gem "jekyll"
#gem "webrick", "~> 1.7"

If you are running Ruby 3x, you will end up with an error when you bundle exec jekyll s because webrick isn't included in ruby 3 or github-pages gem. If you uncomment "webrick" it will work.

Using the github-pages gem is in theory is the way to keep in sync with the actual build environment on GitHub Pages. The Dependency versions lists what is currently included. But notice that this includes "ruby 2.7.4". Bundler doesn't change ruby versions, so it can't deal with the fact that the gem isn't actually compatible with ruby 3 (the breaking change is just that 3 doesn't have webrick).

I commented out github-pages gem just to simplify things and match our other templates, but if you want to use it you could either:

  • use the Gemfile with github-pages + webrick gems as workaround on ruby 3x,
  • use rbenv to install ruby 2.7x to stay in sync as intended.

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