I would use ruby build with rbenv.
Brew update ruby build.
Updating ruby build to get the latest rubies.
Brew update brew install ruby build brew install rbenv rbenv install 2 7 1 rbenv global 2 7 1.
Ruby build installs a non homebrew openssl for each ruby version installed and these are never upgraded.
Brew update brew install whatever or.
Brew update brew install rbenv brew install ruby build install gcc.
It is available as a plugin for rbenv that provides the rbenv install command or as a standalone program.
Brewアップデート brew update 2.
Set up rbenv in your shell.
To link rubies to homebrew s openssl 1 1 which is upgraded add the following.
Brew install head ruby build usage using rbenv install with rbenv.
Homebrew no auto update 1 brew install whatever the advice in travis documentation to not do a brew update if it doesn t seem to be needed seems to leave you at risk of random breakage when brew s ruby requirement is changed.
To update ruby build run git pull to download the latest changes.
Brew upgrade rbenv ruby build 3.
Ruby build is a command line utility that makes it easy to install virtually any version of ruby from source.
Ruby buildアップグレード brew upgrade ruby build 4.
Eventually update rbenv if you come in later you can continue from here.
Open bash profile you can write nano bash profile and add the following line to your bash profile file.
Brew update brew tap homebrew dupes brew install autoconf automake apple gcc42 the new gcc will coexist happily alongside the default one.
Brew update ruby buildのアップデート brew upgrade ruby build linux ubuntu の場合.
Installing as a standalone program advanced installing ruby build as a standalone program will give you access to the ruby build command for precise control over ruby version installation.
The following lines install ruby 2 7 1 and set it as your default ruby version.
No rocket science here just because i always forget if you are using rbenv with the ruby build plugin and want to upgrade to the latest version of ruby you might have to update ruby build to get the latest definitions.