16

How can i completely uninstall rbenv ?

I want to install rvm and I want to get rid of rbenv completely so they don't clash.

This is what I did so far:

  1. rm -rf ~/.rbenv

  2. cleared all the lines added to my ~/.profile file

  3. closed and reopened my shell

But still get left with a rbenv command line tool so when i run rbenv i get the same output as before, with all the options, minus all the ruby versions i had installed before.

EDIT:

When i run which rbenv i get usr/bin/rbenv. Should it be safe to just delete it from there?

mpapis
  • 52,729
  • 14
  • 121
  • 158
Zippie
  • 6,018
  • 6
  • 31
  • 46
  • Try closing and reopening your shell. Is it still there? – Linuxios Sep 30 '13 at 21:27
  • yes, i tried that already – Zippie Sep 30 '13 at 21:27
  • 2
    How did you install it? If you used a package manager, e.g. `apt-get` I would try using that, e.g. `apt-get remove rbenv` – Michael Durrant Sep 30 '13 at 21:47
  • Actually i didn't use a package manager, i followed the instructions here: https://github.com/sstephenson/rbenv#installation And this did the trick. Write your explanation as an answer so i can accept it, or even rather, i would erase this question cause it is too embarrassing. – Zippie Sep 30 '13 at 21:51

2 Answers2

15

Michael Durrant helped me with his comment, i was an idiot not to think that way in the first place, i just had to do:

apt-get remove rbenv

Since i didn't install it through a package manager, rather followed the instructions on GitHub, i thought that it wasn't appropriate (although i first tried apt-get uninstall instead of apt-get remove).

Zippie
  • 6,018
  • 6
  • 31
  • 46
  • 3
    'apt-get remove' didn't do anything for me. I executed the commands that @zippie listed in the original post and also removed rbenv stuff from .bashrc. After that, rbenv appeared to be gone. – Greg May 06 '14 at 16:21
  • I had to do the same, rbenv wasn't installing the ruby versions `2.1.0` and `2.2.0` strange. I used RVM and wanted to try `rbenv` – pixel 67 Dec 28 '14 at 10:06
  • I use `apt-get autoremove rbenv` that works fine for me. – Ali Adnan May 07 '18 at 12:43
  • It didn't work for me, I run the command you mentioned and removed `rbenv` from my system but when I check it using a command `rbenv -v` it shows me the version of `rbenv`. – Curious Developer Nov 21 '18 at 13:12
3

If you installed rbenv using apt-get, then

apt-get remove rbenv

or

sudo apt-get purge --auto-remove rbenv

is a good first step. Next steps should be: nuke the ~/.rbenv directory and all references to "rbenv" in ~/.bashrc, .bash_profile, or similar shell initialization files.

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
Shafayet Hossen
  • 336
  • 1
  • 9