How to install Rails on macOS Catalina.
Please refer to it when setting up in a local environment such as Rails tutorial.
- OS: macOS Catalina
- Ruby: 2.7.1
- Rails: 5.1.6
- Install Command line tools from the terminal:
- Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
- Install rbenv:
brew install rbenv
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
- MacOS Catalina has been changed from bash to zsh.
- Install Ruby using rbenv:
rbenv install 2.7.0
- Set default Ruby:
rbenv global 2.7.0
- Install the required software:
brew install yarn
- Rails installation:
gem install rails -v 5.1.6
- If you do not restart the terminal, the default Ruby will be called and an error may occur.