How to uninstall or remove ruby version from rbenv. I have installed two versions of ruby. While switching to ruby 1.9.3, I am getting segmentation fault. Can anyone please help, how to remove a particular version from rbenv?
Uninstall Ruby on Mac with rbenv For rbenv, use rbenv versions to see which versions you have installed. Use the uninstall command to remove a version. This will remove any gems associated with the version as well. If you want to reinstall Ruby, see Install Ruby on Mac for recommendations of newer version managers.
Any gems that you install while using an RVM's ruby version, is self contained in that version. However there may come a time when you no longer want to use a particular ruby version and want to delete it along with all it's gems. Then this can be done using the “remove” command.
Rbenv by itself does not install Ruby implementations at all. You simply give it the path to an already installed Ruby implementation. There are several projects that make installing Ruby implementations easier.
New way
Use the uninstall
command: rbenv uninstall [-f|--force] <version>
rbenv uninstall 2.1.0 # Uninstall Ruby 2.1.0
Use rbenv versions
to see which versions you have installed.
Old way
To remove a Ruby version from rbenv, delete the corresponding directory in ~/.rbenv/versions
. E.g.
rm -rf ~/.rbenv/versions/1.9.3-p0
Run rbenv rehash
afterwards to clean up any stale shimmed binaries from the removed version.
ruby-build now adds an uninstall command to rbenv to handle the removal of ruby versions, if you want to avoid manual rm -fr
(which might be considered risky) and rbenv rehash
suggested by @Stephenson. For removing ruby version 1.9.3-p0 you would run the following:
rbenv uninstall 1.9.3-p0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With