Before installing RVM and Ruby, we will need to add two tools which help us to verify that we're installing the software that we're expecting.
- Open the "Terminal" application using "Spotlight Search"
- Type
brew install gmp
and press<Enter>
- Type
brew install gnupg
and press<Enter>
If you get an error saying "command not found: brew", Homebrew may not be installed or failed to install correctly. Please go back through the "MacOS System Setup" lesson first before going through the rest of this one.
If you get an error saying "Warning: gnupg-1.4.19 already installed", GnuPG is installed, but it may not be linked properly. To fix:
- Open the "Terminal" application using "Spotlight Search"
- Type
brew link gnupg
and press<Enter>
Ruby Environment Manager (RVM) is a tool that will allow you to download and install multiple versions of Ruby, one of the programming languages that we teach at Flatiron School. This is the first step in installing Ruby on your macOS operating system.
- Open the "Terminal" application using "Spotlight Search"
- Type
gpg --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
and press<Enter>
- Type
\curl -sSL https://get.rvm.io | bash -s stable
and press<Enter>
- Close and reopen the "Terminal" application
- Type
rvm
and press<Enter>
If you see a long message ending in "For additional documentation please visit https://rvm.io", continue below.
If rvm
is not found, check out the troubleshooting steps in the Verify and
Troubleshoot your macOS Environment Setup lesson later on in this module.
For our Ruby labs and lessons, we expect that students use Ruby version 2.7.4. If Ruby Environment Manager (RVM) has been successfully installed, you can quickly install Ruby with a couple of commands.
- Open the "Terminal" application using "Spotlight Search"
- Type
rvm install 2.7.4 --default
and press<Enter>
- Type
rvm list
and press<Enter>
If you see a message starting with "=* ruby-2.7.4", continue below.
Ruby Gems are small programs written in Ruby that help you to code more easily in Ruby. The gems you will install today include: Bundler, which allows you to keep track of which gems your projects need to work, and Pry, which allows you to pause Ruby code execution when it runs and inspect it.
- Open the "Terminal" application using "Spotlight Search"
- Type
gem update --system
and press<Enter>
- Type
gem install bundler
and press<Enter>
- Type
gem install pry
and press<Enter>
- Type
gem list | wc -l
and press<Enter>
If you can complete each step without any issues and you see an output of a number around or above 60 from the last command, continue to the next lesson, Configuring Git and GitHub on macOS.