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

Moving to Ruby 3.0, Jekyll 4 #862

Open
eguiraud opened this issue Jun 9, 2023 · 6 comments
Open

Moving to Ruby 3.0, Jekyll 4 #862

eguiraud opened this issue Jun 9, 2023 · 6 comments
Assignees

Comments

@eguiraud
Copy link
Member

eguiraud commented Jun 9, 2023

Our website build process depends on the github-pages gem, which does not support Jekyll 4 so we are stuck at Jekyll 3.9, and Jekyll 3.9 does not work with ruby 3, so we are stuck with ruby 2.7.

Ruby 2.7 died 2 months ago.

Building our site with Ruby 3.0 is possible, but we have to drop the dependency on the github-pages gem.

This Gemfile works for me with Ruby 3.0.5 and Jekyll 4.3.2 (with the caveat that I have not done extensive testing):

source "https://rubygems.org"

# Use the latest version.
gem "jekyll"
gem "webrick"

group :jekyll_plugins do
  gem "jekyll-paginate"
  gem "jekyll-sitemap"
  gem "jekyll-gist"
  gem "jekyll-feed"
  gem "jekyll-include-cache"
  gem "jekyll-liquify"
  gem "jekyll-archives"
  gem "jekyll-remote-theme"
end

There are also a couple of SCSS deprecation warnings but they seem easy to fix.

EDIT:

the warnings are coming from our fork of the minimal-mistakes theme and I fixed them in root-project/minimal-mistakes#22 .

@Axel-Naumann
Copy link
Member

Building our site with Ruby 3.0 is possible

Looks like building out side with Ruby 3.1 is now required:
https://github.com/root-project/web/actions/runs/7005437970/job/19055168177?pr=924#step:4:194

+ bundle exec jekyll build --baseurl=924/ --destination build/924
bundler: failed to load command: jekyll (/usr/gem/bin/jekyll)
/usr/gem/gems/jekyll-liquify-0.0.3/lib/jekyll-liquify.rb:15:in `<top (required)>': uninitialized constant LiquidFilter (NameError)

Liquid::Template.register_filter(LiquidFilter)
                                 ^^^^^^^^^^^^
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:60:in `require'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:55:in `each'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:55:in `block in require'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:44:in `each'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:44:in `require'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler.rb:186:in `require'
	from /usr/gem/gems/jekyll-3.9.3/lib/jekyll/plugin_manager.rb:51:in `require_from_bundler'
	from /usr/gem/gems/jekyll-3.9.3/exe/jekyll:11:in `<top (required)>'
	from /usr/gem/bin/jekyll:25:in `load'

No new webpages until this is fixed. @couet could you please follow what Enrico suggests here and there and see whether that makes things work? It cannot get much more broken than now, so please be courageous.

Best would be to rebase our minimal-mistakes commits on top of upstream's master.

@couet
Copy link
Member

couet commented Nov 28, 2023

Hi @eguiraud I am running with ruby 3 since a long time and I need to have my now Gemfile to be able to build the web site locally on my machine. My local Gemfile is:

source "https://rubygems.org"

gem "github-pages", group: :jekyll_plugins
gem "webrick"

# If you have any plugins, put them here!
group :jekyll_plugins do
  gem "jekyll-paginate"
  gem "jekyll-sitemap"
  gem "jekyll-gist"
  gem "jekyll-feed"
  gem "jekyll-include-cache"
  gem "jekyll-liquify"
end

The only difference with the current Gemfile is the line:

gem "webrick"

I see your proposed GEmfile has more modifications. Are they really needed ? I can build the ROOT website locally with ruby 3 with only this extra line.

@couet
Copy link
Member

couet commented Nov 28, 2023

Actually forget my comment, the Gemfile file I have on my Mac book is very close to the one you propose.
The one I was talking about just before is on my IMac. I'll test yours on my MacBook

@couet
Copy link
Member

couet commented Nov 28, 2023

The only difference between your GEmfile and the one I have on my MacBook is the that you changed the line:

gem "github-pages", group: :jekyll_plugins

By the line

gem "jekyll"

If I do that (use gem "jekyll") then the web site doesn't not build locally for me.
I guess I can make a PR with the Gemfile I have on my MacBook and see what it does ...

@couet
Copy link
Member

couet commented Nov 28, 2023

On my Mac I have:

% jekyll --version
jekyll 4.3.2
% ruby --version
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin21]

And the web site builds fine with the Gemfile posted here: #925

The PR does not work and gives the error:

bundler: failed to load command: jekyll (/usr/gem/bin/jekyll)
/usr/gem/gems/jekyll-liquify-0.0.3/lib/jekyll-liquify.rb:15:in `<top (required)>': uninitialized constant LiquidFilter (NameError)

Liquid::Template.register_filter(LiquidFilter)

@Axel-Naumann
Copy link
Member

Turns out (thanks @couet !) that jekyll-liquify v0.0.3 doesn't work for us, only 0.0.2 does. Forcing 0.0.2 fixes the current build problems - but this issue here remains and needs to be addressed (e.g. by #931)

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

3 participants