[Ruby on Rails (RoR)] Use brew to install Ruby on macOS with the Homebrew package manager
brew install ruby
This article is about how to use brew
install Ruby on macOS with the Homebrew package manager.
Ruby versions 2.0 and above are included by default in macOS releases since at least El Capitan (10.11).
Prerequisites
-
Xcode Command Line Tools
The Xcode Command Line Tools Package is a small self-contained package available for download separately from Xcode and that allows you to do command line development in macOS which is consists of the macOS SDK and command-line tools such as Clang, which are installed at thisFor more information about installing and using Xcode Command Line Tools, see the Xcode Command Line Tools - https://developer.apple.com/downloads/index.action
-
Homebrew
Homebrew is the Missing Package Manager for macOS (or Linux).For more information about installing and using Homebrew, see the Homebrew - https://brew.sh/.
Installation
1 | macOS |
This should install the latest Ruby version in the /usr/local/Cellar/ruby
folder.
References
[1] Installing Ruby - https://www.ruby-lang.org/en/documentation/installation/