Skip to content

Instantly share code, notes, and snippets.

@pH-7
Last active August 12, 2023 09:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pH-7/aca0ebdcb2282390cd7c95f0bb774b86 to your computer and use it in GitHub Desktop.
Save pH-7/aca0ebdcb2282390cd7c95f0bb774b86 to your computer and use it in GitHub Desktop.
How to install Ruby 3 with Rails v7, on macOS?

How to install Ruby & Rails on macOS?

Here are the simple 4 steps to install Ruby 3 and Rails v7 on macOS

Step 1: Install Homebrew

First, open your Terminal and run the following steps (I personally use iTerm2).

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

Step 2: Install rbenv

brew update
brew install rbenv ruby-build
echo '\nif which rbenv > /dev/null; then eval "$(rbenv init -)"; fi\n' >> ~/.zshrc
source ~/.zshrc

Step 3: Install Ruby (v3.2.2)

rbenv install 3.2.2
rbenv global 3.2.2

# check version
ruby -v
# ruby 3.2.2

Step 4: Install Rails (v7.0.6)

gem install rails -v 7.0.6

Now, let's check if Ruby on Rails is correctly install by checking its version

rails -v
# Rails 7.0.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment