Setting Up MacOS for Ruby Programming

This runbook details what commands to run to get a new MacBook to run Ruby scripts. All of these commands are run in the Terminal application which comes installed on every MacBook. These command will install the libraries: Homebrew, GPG, RVM, and Ruby.

Have Terminal open, and run these commands in order, replacing variables found in square brackets with values specific to the MacOS machine.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

echo >> /Users/[USER NAME]/.zprofile

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/[USER NAME]/.zprofile

eval "$(/opt/homebrew/bin/brew shellenv)"

gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

\curl -sSL https://get.rvm.io | bash

source ~/.zshrc

rvm install ruby-3.3.1 --with-openssl-dir=$(brew --prefix openssl@3)

curl -sSL https://gitlab.com/-/snippets/4830778/raw/main/verify-ruby.sh | bash

Made on MacBook Pro, April 2025.

alexa anderson

About the Author

Alexa Anderson is an engineer and evangelist with a penchant for making products geared for progress and achievement. When not writing software, Alexa spends her time curating content and sharing her discoveries.