I accidentally installed rails locally, so I'll write an article about the procedure when uninstalling.
macOS Catalina version 10.15.7 Homebrew 2.7.1 rbenv 1.1.2 ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19] gem 3.2.4 Bundler version 2.1.4
cd to change to your home directory.
Next, check the installation status of gem with
gem list *** LOCAL GEMS *** . . . rails (6.1.0, 184.108.40.206, 6.0.0) rails-dom-testing (2.0.3) rails-html-sanitizer (1.3.0) rails-i18n (6.0.0) railties (6.1.0, 220.127.116.11, 6.0.0) rake (13.0.3, 13.0.1, 12.3.2) . . .
rails (6.1.0, 18.104.22.168, 6.0.0)
Since only rails6.0.0 is used, uninstall the other two.
I wondered if only
gem uninstall rails was enough, but when I looked it up, it seems that
railties also needs to be deleted.
gem uninstall rails -v '22.214.171.124' gem uninstall railties -v '126.96.36.199'
When you type the above command, the following will be displayed.
You have requested to uninstall the gem: railties-188.8.131.52 rails-184.108.40.206 depends on railties (= 220.127.116.11) If you remove this gem, these dependencies will not be met. Continue with Uninstall? [yN] y Successfully uninstalled railties-18.104.22.168
You will be asked "Can I uninstall rails?", So enter
[yN] means [yes or No].
gem uninstall rails -v '6.1.0' gem uninstall railties -v '6.1.0' You have requested to uninstall the gem: railties-6.1.0 rails-6.1.0 depends on railties (= 6.1.0) If you remove this gem, these dependencies will not be met. Continue with Uninstall? [yN] y
Check if it can be uninstalled.
rails -v Rails 6.0.0
It was done! !!
Finally, load it with
bundle inatall to reflect the changes.
I am posting an article in the hope that it will help people who are similarly troubled. See you next time ~