Is Xcode Command Line Tools Installed?
You need to install Xcode Command Line Tools for the Unix tools needed to install Ruby and develop applications.
Xcode Command Line Tools provide the C language compiler you'll need to install Ruby. Also, for many Ruby projects, you will need the C language compiler to automatically install gems that use native extensions (some gems speed up Ruby by using code written in C).
Check Xcode Command Line Tools
Check for Xcode Command Line Tools with pkgutil
. Check the version of Xcode Command Line Tools by running pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
in the Terminal application.
$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 15.0.0.0.1.1694021235
You should see version 15 or newer.
Missing or outdated Xcode Command Line Tools
If Xcode Command Line Tools is missing or outdated, see Xcode Command Line Tools Already Installed?.
What's next
The Mac Install Guide website contains all the instructions you need to set up your Mac as a development environment.
To continue installing Ruby:
You can install Ruby directly with Homebrew:
Or install Ruby with a software version manager: