Ruby

audience developer
level all
topic Ruby
subtopic Installation

Update Ruby 3.4

Update Ruby on Mac. Install Ruby 3.4, the Ruby latest version. How to update the Ruby version on macOS. How to download and upgrade Ruby.

Ruby 3.4 was released December 25, 2024. Customarily, new versions of Ruby are released at Christmas. Ruby 3.4 is faster than previous versions. There's a new IRB, the interactive Ruby interpreter, with better autocompletion and debugging. Most of the Ruby 3.4 changes will lead to improved developer tooling. The language API is largely unchanged and consistent with previous releases.

You can read about changes in Ruby 3.4:

You can read about changes in Ruby 3.3:

Upgrading to Ruby 3.4 will likely be painless and provide improvements in developer experience plus small performance gains.

Here you'll learn how to check which version manager you're using. Then I show how to update to Ruby 3.4 with each.

Before you get started

You'll need a terminal application to update Ruby. Apple includes the Mac terminal but I prefer Warp Terminal. Warp is an easy-to-use terminal application, with AI assistance to help you learn and remember terminal commands. Download Warp Terminal now; it's FREE and worth a try.

You'll need Xcode Command Line Tools before you install Ruby. You can Install Xcode Command Line Tools with Homebrew.

It's optional, but if you're setting up a local development environment you'll need to Install Git and Configure Git with the Git Credential Manager so you can save your work as you go with version control.

Time to switch version managers?

Most developers use a software version manager to switch among multiple versions of Ruby. Rbenv and rvm have been popular for years but many developers have switched to asdf, frum, or chruby. I've written a guide Install Ruby on Mac that compares version managers and recommends either asdf or frum. If you're upgrading Ruby, you might want to change version managers at this time.

How was Ruby Installed?

Check which version manager you've used to install Ruby.

The command which -a ruby will show you where Ruby is installed.

$ which -a ruby

The installation location will show you how Ruby was installed. Results will also show if more than one Ruby executable is installed.

Here is a list of possible results.

The system Ruby

$ which -a ruby
/usr/bin/ruby

If you see /usr/bin/ruby, it is the system Ruby which comes pre-installed on macOS to support scripting. See the article Do Not Use the MacOS System Ruby for an explanation (the system Ruby is there for macOS, not you). Don't try to remove the system Ruby. Leave it in place and use Homebrew or a version manager to install a newer Ruby version. Installation of Homebrew or a version manager will require setting your shell configuration to override or pre-empt the system Ruby.

Homebrew

Homebrew is a package manager, not a version manager. It only installs one version of Ruby. You cannot switch among Ruby versions with Homebrew (install a version manager if you need to switch among Ruby versions).

$ which -a ruby
/usr/local/bin/ruby

or

$ which -a ruby
/opt/homebrew/opt/ruby/bin/ruby

If Ruby was installed by Homebrew, you'll see /usr/local/bin/ruby (on Intel silicon) or /opt/homebrew/opt/ruby/bin/ruby (on Apple silicon).

As of December 31, 2024, Ruby 3.4.1 was available for installation with Homebrew. Check the Homebrew Ruby current version to see which Ruby is currently installed by Homebrew.

See Install Ruby with Homebrew for instructions.

See Uninstall Ruby on Mac if you want to remove earlier versions.

RVM

See Install Ruby on Mac for recommendations of newer version managers.

Here's how to check if Ruby was installed with RVM.

$ which -a ruby
~/.rvm/rubies/

If Ruby was installed with rvm, it will be in ~/.rvm/rubies/ by default.

Install Ruby 3.4 and set as default:

$ rvm install 3.4.1
$ rvm use 3.4.1
$ ruby --version

See Uninstall Ruby on Mac if you want to remove earlier versions.

rbenv

See Install Ruby on Mac for recommendations of newer version managers.

Here's how to check if Ruby was installed with rbenv.

$ which -a ruby
~/.rbenv/versions/

If Ruby was installed with rbenv (with the ruby-build utility), it will be in ~/.rbenv/versions/ by default.

Install Ruby 3.4 with the ruby-build utility:

$ ruby-build 3.4.1

See Uninstall Ruby on Mac if you want to remove earlier versions.

chruby

$ which -a ruby
~/rubies/

If Ruby was installed with chruby (with the ruby-install utility), it will be in ~/rubies/ by default.

See Install Ruby with Chruby for instructions. The short version:

$ ruby-install --latest ruby

See Uninstall Ruby on Mac if you want to remove earlier versions.

frum

$ which -a ruby
/var/folders/...

If Ruby was installed with frum, it will be in /var/folders/... by default.

See Install Ruby with Frum for instructions. The short version:

$ frum install 3.4.1

See Uninstall Ruby on Mac if you want to remove earlier versions.

asdf

$ which -a ruby
~/.asdf/shims/ruby

If Ruby was installed with asdf, you will see the ~/.asdf/shims/ruby directory.

Ruby versions are installed by default in ~/.asdf/installs/ruby.

See Install Ruby with Asdf for instructions. The short version:

$ asdf install ruby latest

See Uninstall Ruby on Mac if you want to remove earlier versions.

What's next

My mac.install.guide is a trusted source of installation guides for professional developers. Take a look at the Mac Install Guide home page for tips and trends and see what to install next.