Check Ruby Version on Mac
How to check your Ruby version on Mac. Check the current Ruby version from the command line and find where Ruby is installed on macOS. Check and compare Ruby project requirements.
When you start working on a Ruby project, either your own project or joining a team, you need to check both the Ruby version for the project and the Ruby runtime installed on your Mac. This guide will show you how to find the Ruby version required by any project, as well as checking your Mac for installed Ruby versions.
It's not unusual to join a team on a legacy project that depends on an older Ruby version that has not been updated. Developers will install a project's required Ruby version on their Mac alongside the latest stable Ruby release. A version manager such as Mise or rv helps you switch between Ruby versions as needed. That way, older projects keep working while you start fresh with the newest Ruby for new projects.
After checking your Ruby version, you might want to Update Ruby or Uninstall Ruby to get what you need.
Checking your Ruby version is one step in setting up your Mac for development. See the full roadmap to set up a Mac for software development.
Before you get started
You'll need a terminal application to work with 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 is FREE and worth a try.
What Ruby version does a project require?
Before you check what Ruby version is installed on your Mac, find out which Ruby version the project needs. A project README file may specify the required version but it is best to verify with project configuration files. You'll usually find a configuration file in the project root directory that specifies a required version. Look for these files when you clone or open a project.
If you want to update a project to use a newer Ruby version, see the article Change the Ruby Version for a Project (how to change the version a project requires).
Check for a .ruby-version file
Most Ruby projects include a .ruby-version file. This is the most common and widely supported way to pin a Ruby version. The file contains a single version number:
$ cat .ruby-version
4.0.2
All major version managers read this file, including Mise, rv, chruby, rbenv, and rvm. If the project has a .ruby-version file, your version manager will switch to that version automatically when you enter the project directory.
Check for a .tool-versions file
Projects that use asdf or Mise may use a .tool-versions file instead. This file can pin versions for multiple languages on separate lines:
$ cat .tool-versions
ruby 4.0.2
nodejs 22.0.0
The tool rv also reads .tool-versions files, so this format works across version managers.
Check for a Gemfile ruby directive
Some projects specify the Ruby version in the Gemfile (the file that lists gem dependencies). Look for a ruby line near the top:
$ head -5 Gemfile
source "https://rubygems.org"
ruby "4.0.2"
The Gemfile ruby directive tells Bundler to verify the Ruby version at install time. It does not switch versions for you. You still need a version manager to install and activate the correct version.
Check for a mise.toml file
Projects that use Mise may have a .mise.toml configuration file. Check for a Ruby version entry:
$ cat .mise.toml
[tools]
ruby = "4.0.2"
No Ruby version file found
If the project has no version file, check the project README or ask the team which Ruby version to use. For new projects, use the latest Ruby version.
First steps to check Ruby version on Mac
After you know what Ruby version your project requires, check which Ruby is on your Mac.
But first, do you want to check the macOS version? Take the time to make sure your operating system is up to date and update macOS to the latest macOS version. Then Set Up a Mac Like a Pro with all the best settings and preferences.
Here are steps to check the Ruby version on Mac (more details below).
- use
ruby -vto check the version number - use
which -ato see if other Ruby versions are installed - use
gem envfor full environment details
Check the Ruby version with ruby -v
To find out what version of Ruby is installed on macOS, Open a terminal application and check:
$ ruby -v
Don't type the $ character. The $ character is just a cue that you should enter a shell command. If you enter it, you'll get the error Command not found: $.
If Ruby is installed, the ruby -v command will show a response like:
$ ruby -v
ruby 4.0.2 (2026-03-17 revision d3da9fec82) +PRISM [arm64-darwin25]
If you run ruby -v and see Ruby version 2.6.10, it is the system Ruby. See Why You Shouldn't Use macOS System Ruby. You'll need to install the Latest Ruby Version. If you run into problems after installing Ruby, see Troubleshoot Ruby Installation.
You could see zsh: command not found: ruby but that is unusual, as it can only happen if someone uninstalled the macOS system Ruby.
Check the Ruby location with which
The which command will show the location of any Ruby runtime that is recognized by the shell:
$ which ruby
/opt/homebrew/opt/ruby/bin/ruby
The filepath shows the location, which is a clue to how Ruby was installed. In this example, it is the Ruby installed by Homebrew on an Apple Silicon (M-Series) laptop.
Here's the system Ruby:
$ which ruby
/usr/bin/ruby
If you see /usr/bin/ruby, it is the pre-installed macOS system Ruby. As previously mentioned, it is a bad idea to use the Mac system Ruby. See the article Why You Shouldn't Use macOS System Ruby.
All the Rubies
The which -a command will show you all the Ruby runtimes on the Mac PATH, if more than one Ruby executable is installed:
$ which -a ruby
/Users/daniel/.asdf/shims/ruby
/usr/bin/ruby
If Ruby is installed, the which command may show the Ruby version number in the file path:
/Users/daniel/.rvm/rubies/ruby-3.0.0/bin/ruby
You might want to Update Ruby or Uninstall Ruby if you don't see what you want.
Find the Ruby version with gem env
The gem env command gives you a full picture of your local Ruby environment, including the RUBY VERSION and INSTALLATION DIRECTORY:
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 4.0.8
- RUBY VERSION: 4.0.2 (2026-03-17 patchlevel 0) [arm64-darwin25]
- INSTALLATION DIRECTORY: /opt/homebrew/lib/ruby/gems/4.0.0
- USER INSTALLATION DIRECTORY: /Users/daniel/.local/share/gem/ruby/4.0.0
- CREDENTIALS FILE: /Users/daniel/.local/share/gem/credentials
- RUBY EXECUTABLE: /opt/homebrew/opt/ruby/bin/ruby
- GIT EXECUTABLE: /usr/bin/git
- EXECUTABLE DIRECTORY: /opt/homebrew/lib/ruby/gems/4.0.0/bin
- SPEC CACHE DIRECTORY: /Users/daniel/.cache/gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /opt/homebrew/Cellar/ruby/4.0.2/etc
- RUBYGEMS PLATFORMS:
- ruby
- arm64-darwin-25
- GEM PATHS:
- /opt/homebrew/lib/ruby/gems/4.0.0
- /Users/daniel/.local/share/gem/ruby/4.0.0
- /opt/homebrew/Cellar/ruby/4.0.2/lib/ruby/gems/4.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => true
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /opt/homebrew/lib/ruby/gems/4.0.0/bin
- /opt/homebrew/opt/ruby/bin
- /opt/homebrew/bin
- /opt/homebrew/sbin
- /usr/local/bin
- /System/Cryptexes/App/usr/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
- /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
- /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
This is a typical Ruby installation with Homebrew.
Version managers
For a guide that compares version managers and shows the best way to install Ruby, see Install Ruby on a Mac.
Rubies installed with a version manager
If a version manager has already been installed, you can tell by entering the version manager name with the -v flag:
$ mise -v
$ rv -v
$ chruby -v
$ asdf -v
Ruby versions in Mise
To list all installed Ruby versions in Mise:
$ mise list ruby
To show the currently active version in Mise:
$ mise current ruby
Ruby versions in rv
To list all installed Ruby versions in rv:
$ rv ruby list
Ruby versions in chruby
To list all installed Ruby versions in chruby:
$ chruby
* 1.9.3-p327
The star shows the currently active version.
Ruby versions in asdf
To list all installed Ruby versions in asdf:
$ asdf list
ruby
2.7.2
3.0.0
To show the currently active version in asdf:
$ asdf current ruby
ruby 3.0.0 /Users/daniel/.tool-versions
The last column shows the file where the default version is set.
Ruby versions in RVM
To list all installed Ruby versions in RVM:
$ rvm list
rvm rubies
* ruby-1.9.3-p484 [ x86_64 ]
ruby-2.0.0-p481 [ x86_64 ]
=> ruby-2.1.1 [ x86_64 ]
# => - current
# =* - current && default
# * - default
The list shows the current and default Ruby versions.
Ruby versions in rbenv
To list all installed Ruby versions in rbenv:
$ rbenv versions
1.9.2-p290
* 1.9.3-p327
The star (asterisk) shows the currently active version.
Update Ruby version
After you have found the Ruby version and learned how it was installed, you may want to Update Ruby.
Continue setting up your Mac
Don't miss the full visual roadmap and checklist that shows how to set up a Mac for software development, with all the essential tools and settings you might not yet know about.