There have been a bunch of topics asking for help on upgrading to Ruby 3 since it came out in December 2020.
I finally made the change to Ruby 3. Today, I put together instructions for macOS and Linux.
In particular, my last post in the series covers how to rebuild your gems and add a missing webrick dependency to stop your Jekyll sites from breaking on Ruby 3.
Thanks again @MichaelCurrin , as i was this morning thinking about this issueā¦ telepathy ? Will do the switch to Ruby 3 and come back with some feedback.
BTW, are you noticing major changes ? what about the so called ā 3x3 ā promiseā¦ in terms of āspeed / performanceā ?
Thank you for sharing this, Michael! Excellent articles as always! I do have a new question to ask, but will do so with a new topic, as it relates directly to configuring Jekyll with Ruby 3.0.1.
Okey, i went the rvm path ā¦ accordingly to my own environment.
Suffered the āno Webrickā bundled ā¦ issue, like others did,
but thanks to info shared here i was just able to quickly fix it, as @MichaelCurrin mentioned,
$ bundle add webrick
and to keep it future-proof , this automatically adds the following to Gemfile
gem "webrick", "~> 1.7"
Enjoy renewed Ruby 3
Still, in some of the websites i develop, iām encountering some issuesā¦ leading to Webrick no being available, even if apparently it got as described in this discussion here. Umfā¦need further investigation from my side, iām afraid of.
Hello I am new to learning Jekyll and only just installed Jekyll and Ruby and therefor have the latest versions installed. I also get the webrick issue and can fix it by adding the ābundle add webrickā command to every project.
But Iām not sure how to fix this so I donāt have to manually add the bundle everytime after running ājekyll new ****ā. Whatās the best way to fix this if youāre not upgrading?
Eventually the Jekyll template created with jekyll new might include that, but while not everyone uses Ruby 3 itās not essential. I understand your frustration though.
Iād say use my template to make a new repo on GitHub and then clone your new repo.
My template is based closely on the output of jekyll new but with some added benefits. Notably - webrick is added to Gemfile so if you do bundle install youāll get webrick
Thanks Michael! Only working with HTML and CSS till now I just found it a bit confusing that Jekyll doesnāt work / wonāt start the server if you just follow the basic instructions to get it up and running, especially if youāre also new to the command line
Just so I got the concept down: instead of running Jekyll new, itās better to just clone a Github repo and then run the bundle command to install all the dependencies?
I tried to do that and got the following error
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.18/lib/bundler/runtime.rb:308:in check_for_activated_spec!': You have already activated i18n 1.12.0, but your Gemfile requires i18n 0.9.5. Prepending bundle exec` to your command may solve this. (Gem::LoadError
Guess I should just create my own Repo and clone that right?
If your site is really simple like a handful of pages and you want to use a plain CSS theme instead of a Jekyll theme, you can try making your site without Jekyll.
So that would be a repo with an index.html file in it and nothing else is needed.
You can use a static server extension in VS Code to serve your contents locally without using the CLI. Or for CLI, use a server in Python or Node or PHP.
Yes my suggestion is to use the cloned repo generated from a template, instead of using jekyll new. As the template will come with the webrick stuff every time to save you that, plus some other nice things in my template.