elixir-europe / infectious-diseases-toolkit

Infectious diseases toolkit
https://www.infectious-diseases-toolkit.org/
Other
8 stars 33 forks source link

Adding a note for users of Ruby 3.x #138

Closed martin-nc closed 1 year ago

martin-nc commented 1 year ago

Link to the page of interest https://www.infectious-diseases-toolkit.org/contribute/working-with-git

Describe what you would like to change on the page In the section "Run using Jekyll directly" , step 5 it says run bundle exec jekyll serve. If you're on Ruby 3.x I think you might run get an error like:

bundler: failed to load command: jekyll (/Users/cookm/.rbenv/versions/3.1.3/bin/jekyll) /Users/cookm/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)

See this issue: https://github.com/jekyll/jekyll/issues/8523. As noted in the issue, the solution is to add webrick: bundle add webrick. So maybe we should add that in point 5: "If this command returns an error, try running bundle add webrick' before trying bundle exec jekyll serve again (see this issue)." @bedroesb I guess this is the "compatibility issue" mentioned in the introduction to this section of the page? Or maybe there are more issues!

bedroesb commented 1 year ago

I wonder if the issue would be solved when we add webrick to the gemfile?

source "https://rubygems.org"

# to publish on github page
gem 'github-pages', group: :jekyll_plugins
gem "webrick"

This way we have also backwards compatibility and people don't have to worry. Could you test if this works?

martin-nc commented 1 year ago

Yes, I updated my local gemfile, ran bundle install again, and then bundle exec jekyll serve worked fine.

I also moved back to Ruby 2.7.7 (from 3.1.3) and ran the whole process again, with the modified gemfile, and everything still worked. So from what I can see it's okay to add the webrick gem to the repo gemfile.

bedroesb commented 1 year ago

wohoow! Let's do that