I regularly build websites using Jekyll, which is built on Ruby. So I need to have control over my Ruby environment and gems.
I recently upgraded to Ruby 3. And now I want to share steps for others, using macOS or Linux.
This series covers
- Deleting the old gems and old Ruby.
- Setting up a new Ruby and updating the path.
- Fixing up gems for projects.
If you've never heard of Ruby, this post is not for you. But check out the Ruby homepage to learn more about the language.
According to the first post below, there are some improvements around performance, concurrency and type checking. Plus changes in syntax and gem updates, as covered in the Other notable changes since 2.7 section.
See also this blog post as a friendlier summary of changes.
Since Ruby 3 has been out about 6 months and has a patch release out, I feel comfortable using it. I would avoid using a major release too soon after it comes out.
For Linux users - before your uninstall Ruby in the post, save yourself some trouble and make sure that Ruby 3 is actually available for your distribution. Using your system's package manager UI to browser can help here.
If you're stuck, then you can install a Ruby environment manager and use that to install Ruby 3.
See also this post which covers using
rvm to install Ruby 3 on Ubuntu.