Now, you should have Ruby 3 ready.
Your Ruby projects will have stale gems and lockfiles though, so you need to make changes to them.
I'm going to walk you through how to update your projects to get them using Ruby 3. This will be similar across projects but I will focus on Jekyll projects. I like to build websites using Jekyll as a static site generator. I have a demo here if you are interest - including an update to the Gemfile
to support Ruby 3.
Repeat the steps below for each Ruby project of yours.
Remove old gems 🙅♂️ 💎
$ rm -rf vendor
This is not strictly necessary, as 2.7 and 3.0 gems are kept in separate directories in the vendor
directory. But if you are never going to use those old gems again, then you can reclaim some space now.
Remove lockfile 🙅♂️ 🗃
$ rm Gemfile.lock
I found that that I got errors running Jekyll, unless I dropped the old lockfile and started over with a fresh set of the latest gems.
Install gems
$ bundle install
Then commit your lockfile.
Install missing gems 🚛 📦
For Jekyll in Ruby 3, you'll get this error on serving.
Load error: cannot load such file – webrick
Fix that by installing Webrick, as per Jekyll issue #8523. Perhaps this will be fixed in newer releases of Jekyll.
Run this to add the gem to your Gemfile
and install it.
$ bundle add webrick
Commit your lockfile.
Start Jekyll
Your Jekyll site should be ready to use now.
$ bundle exec jekyll serve --trace
Thanks for reading. I hope that eases your journey to using Ruby 3.
Credits 📸
Cover image created with Google Jamboard.
Photo by Joshua Fuller on Unsplash
Top comments (1)
Sure... ThX again for sharing Michael.