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
First, use cd
to change to your home directory.
Next, check the installation status of gem with gem list
.
gem list
*** LOCAL GEMS ***
.
.
.
rails (6.1.0, 6.0.3.4, 6.0.0)
rails-dom-testing (2.0.3)
rails-html-sanitizer (1.3.0)
rails-i18n (6.0.0)
railties (6.1.0, 6.0.3.4, 6.0.0)
rake (13.0.3, 13.0.1, 12.3.2)
.
.
.
rails (6.1.0, 6.0.3.4, 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 '6.0.3.4'
gem uninstall railties -v '6.0.3.4'
When you type the above command, the following will be displayed.
You have requested to uninstall the gem:
railties-6.0.3.4
rails-6.0.3.4 depends on railties (= 6.0.3.4)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN] y
Successfully uninstalled railties-6.0.3.4
You will be asked "Can I uninstall rails?", So enter y
.
[yN] means [yes or No].
Then uninstall 6.1.0
.
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.
bundle inatall
That's it.
I am posting an article in the hope that it will help people who are similarly troubled. See you next time ~
https://teratail.com/questions/63276
Recommended Posts