Introduction
In this article, we will guide you through the process of installing Ruby version 2.6.3 on your MacOS system, specifically on Sonoma 14.2. Ruby is a dynamic, open-source programming language with a focus on simplicity and productivity. It is widely used for web development, data analysis, prototyping, and many other applications.
Prerequisites
Before we begin, make sure you have the following prerequisites installed on your system:
- Homebrew package manager
- Xcode command line tools
You can install Homebrew by running the following command in your terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
To install Xcode command line tools, run the following command:
xcode-select --install
Installing Ruby 2.6.3
To install Ruby 2.6.3, we will use the Ruby Version Manager (RVM), a command-line tool that allows you to easily install, manage, and work with multiple ruby environments.
First, install RVM by running the following command in your terminal:
\curl -sSL https://get.rvm.io | bash -s stable
Next, add RVM to your shell by running the following command:
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bash_profile
Now, you can install Ruby 2.6.3 by running the following command:
rvm install 2.6.3
Once the installation is complete, you can set Ruby 2.6.3 as the default version by running the following command:
rvm use 2.6.3 --default
Testing the Installation
To verify that Ruby 2.6.3 is installed and set as the default version, run the following command:
ruby -v
You should see the following output:
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
In this article, we have covered the process of installing Ruby 2.6.3 on MacOS Sonoma 14.2. We have discussed the prerequisites, the steps to install Ruby using RVM, and how to test the installation. Ruby is a powerful and versatile programming language, and installing the correct version is the first step to start developing with it.
References
Types of references included: online resources.