Hey there! Today we’ll be installing Ruby on Rails on macOS. Now, there there are two ways to do this…
Native install
First, you can install Ruby natively on your Mac (actually, it’s already installed for you, but it’s quite outdated. As of this recording the latest macOS comes with Ruby 2.6.10 which was released in April 2022, 2.6 itself was released in December 2019). So, if you know anything about semantic versioning (a topic for another post), then you know that using the pre-installed version of Ruby will have you working (feature-wise) 5.5 years in the past. We could install a later version but…there’s a better way!
Ruby Version Managers
A version manager allows you to easily swap out which version of Ruby you’re running, and allows you to set both a global (default) version, and specific versions by project directory. This makes it much easier if you want to work on multiple projects that have different version requirements, or if someday you want to update the version of Ruby that you used for a project.
RVM
RVM is the OG of Ruby version managers with its 1.0 release in 2010. I have no experience with RVM personally, but I had a manager who used it when I first got into software development 10 years ago.
rbenv
Speaking of 10 years ago, that was my first exposure to Ruby. I adopted rbenv right away (probably based on a Ruby on Rails Udemy course I had followed), and never regretted it. Interestingly, I just noticed that I must have started with a pre-1.0 version because 1.0 wasn’t released until December 2015.
asdf
When I came to TaxJar in 2019, many people were using asdf. It’s very similar to rbenv, but can manage versions of multiple languages and tools via plugins, so I made the switch. I had no problems at all with it.
mise
It’s been a few years since I’ve worked in Rails, and as I prepared to dive back in, I noticed their docs recommend a new kid on the block. mise
has only been around since 2023, and it’s hard to say how stable the project is because they don’t use semantic versioning.
Which to choose?
Normally I would suggest sticking with something proven and with widespread adoption like rbenv and asdf. This will help you have a better experience when questions arise, because they will have likely already been asked and answered.
In the Rails world though, there’s the idea that things should be done “The Rails Way.” It’s often argued about how much you should lean into this. When you get into the framework itself there are things that would be foolish to reinvent on your own, but for something like a version manager, it shouldn’t really matter. In this case however, I’m going to give mise a try, and suggest you do the same. The Rails team doesn’t often change things without reason, and with this being the latest official suggestion, I could see many others adopting it, which will help with finding support when needed.