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.
What is Ruby?
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.
Why upgrade to Ruby 3? π€
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.
- Ruby 3.0.0 Released post - π Dec 2020.
- Ruby 3.0.1 Released post - π April 2021.
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.
Linux warning β οΈ
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 rbenv
or rvm
to install Ruby 3 on Ubuntu.
Top comments (0)