How to install ruby on macOS

Hey everyone, How do I install Ruby On macOS

I use rvm.io

For a while I used ruby-install and chruby from brew.sh

There is also rbenv but I never used it.

also I am on macOS 12 Monterey

Go Rails has very nice guides: Install Ruby On Rails on macOS 14 Sonoma (Apple Silicon, M1, M2, M3) | GoRails

1 Like

I’ll second RVM. It’s old but it works and is still being updated with the latest rubies.

I think asdf looks like a newer option that handles more than just ruby, but I haven’t used it yet because I only use ruby lately.

I would say that if you are going to go with RVM, I would skip gemsets. They used to be useful but bundler has made them largely obsolete.

On macOS 14.7 Sonoma and have some Linux environments.

I’ve used Rbenv on all of them for Rails and other Ruby apps.

I ran into a fair share of hurdles before I felt I had a handle on it. I documented my best practices here.

Thanks everyone I got it

You can do this with a one line command using https://rails.new/ as well and it’s a free tool. It uses rbenv to install ruby.

(P.S. I am also one of the author)

I have been playing with rails for the first time, too, and had the same question. I opted for using mise, which is similar to asdf.

Essentially:

$ brew install mise
$ mise use --global ruby@latest

You can fine-tune your ruby environment with mise, e.g., use a different ruby version for your rails project A vs. rails project B. See the mise docs for more information.

1 Like