Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rstewa/c1bb7eb5a91a6ea56fbda7a0bb8f6f59 to your computer and use it in GitHub Desktop.
Save rstewa/c1bb7eb5a91a6ea56fbda7a0bb8f6f59 to your computer and use it in GitHub Desktop.
Ruby on Rails install guide for MacOS Ventura

Ruby Rails Install Guide for MacOS Ventura

Step 1: Install Homebrew

Run this command inside your terminal to install Homebrew:

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

Step 2: Install Ruby

MacOS comes with Ruby pre-installed but we're going to use Homebrew to get the latest version.

To install Ruby with Homebrew, run:

brew install ruby

Step 3: Add Ruby to Path:

Now we need to add this installation to our path so that its used instead of the default MacOS one.

  1. Get the location of your Homebrew installed Ruby:
brew info ruby
  1. Get the location of your gems:
gem environment gemdir
  1. Use those to run the following command to prepend those locations to your path:
echo 'export PATH="{your-ruby-location}:{your-gem-location}:$PATH"' >> ~/.zshrc

Note Depending on your shell, you might need to replace ~/.zshrc with ~/.bashrc or ~/.bash_profile, etc.

Mine looked like this:

echo 'export PATH="/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/3.2.0/bin:$PATH"' >> ~/.zshrc

Restart your terminal and run:

which ruby

to verify that it points to the Homebrew installed Ruby.

Step 4: Install Ruby on Rails

Run the following to install Ruby on Rails:

gem install rails

Restart your terminal and you should be good to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment