paint-brush
Is Ruby Installed On A Mac? How To Check On macOS Catalina and Big Surby@railsapps
691 reads
691 reads

Is Ruby Installed On A Mac? How To Check On macOS Catalina and Big Sur

by Daniel Kehoe
Daniel Kehoe HackerNoon profile picture

Daniel Kehoe

@railsapps

Author of the book, "Learn Ruby on Rails" and founder...

February 25th, 2021
Read on Terminal Reader
Read this story in a terminal
Print this story
Read this story w/o Javascript
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Is Ruby installed on a Mac? How To Check On macOS Catalina and Big Sur? How to check if Ruby is installed. MacOS comes with a "system Ruby" pre-installed. You may not want to use the MacOS system Ruby because it is an older version of Ruby. You could also use a version manager such as asdf, chruby, rbenv, or rvm. A version manager can also help if you're juggling multiple projects that can't be updated all at once.
featured image - Is Ruby Installed On A Mac? How To Check On macOS Catalina and Big Sur
Daniel Kehoe HackerNoon profile picture
Daniel Kehoe

Daniel Kehoe

@railsapps

Author of the book, "Learn Ruby on Rails" and founder of the RailsApps open source project.

About @railsapps
LEARN MORE ABOUT @RAILSAPPS'S
EXPERTISE AND PLACE ON THE INTERNET.

Is Ruby installed on my Mac?

Ruby comes pre-installed on macOS Catalina and Big Sur (see below why you may not want to use the default Ruby).

To check if Ruby is installed, enter in your terminal application:

$ ruby -v

(Don't type the

$
character.)

If Ruby is not installed, you'll see:

zsh: command not found: ruby

The

which
command will confirm that Ruby is missing:

$ which ruby
ruby not found

You can use the

which
command with flag
-a
to see if more than one Ruby executable is installed:

$ which -a ruby
/Users/daniel/.asdf/shims/ruby
/usr/bin/ruby

If Ruby is installed, the

ruby -v
command will show a response like:

$ ruby -v
ruby 2.6.3p62

MacOS comes with a "system Ruby" pre-installed. Use the `which` command to see if you are using the system Ruby:

$ which ruby
/usr/bin/ruby

If you see

/usr/bin/ruby
, it is the pre-installed macOS system Ruby. It's fine to use the system Ruby for running sysadmin scripts, as long as you don't alter the system Ruby by attempting to update it or add gems. But experienced developers don't use the system Ruby for developing projects in Ruby.

You may not want to use the MacOS system Ruby because it is an older version of Ruby. Instead, you can Install Ruby with Homebrew. You could also use a version manager such as asdf, chruby, rbenv, or rvm. A version manager can also help if you're juggling multiple projects that can't be updated all at once.

For a guide that compares version managers and shows the best way to install Ruby, see Install Ruby on a Mac. If you're going to build web applications with Rails, see Install Ruby on Rails on a Mac.

Also published on Dev.to.

L O A D I N G
. . . comments & more!

About Author

Daniel Kehoe HackerNoon profile picture
Daniel Kehoe@railsapps
Author of the book, "Learn Ruby on Rails" and founder of the RailsApps open source project.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here
Coffee-web
Hashnode
X REMOVE AD