Installing Ruby using rbenv
At BigBinary we recommend to use rbenv to manage ruby versions.
On terminal execute the following command.
1$ brew instal rbenv
Execute code ~/.bashrc. At the bottom of the file add eval "$(rbenv init -)".
Quit terminal and open a new terminal. Execute ruby install 2.7.1 to install ruby 2.7.1. This will take sometime. Please be patient.
Execute rbenv init.
Execute rbenv global 2.7.1. Now you are all set.
rbenv respects .ruby-version file
In your Rails application you will find a .ruby-version file. This file contains the ruby version that the application is using. When rbenv sees a .ruby-version file then rbenv reads that ruby version from that file and sets up to use that version of ruby.