0

I recently installed the Ruby Version Manager (RVM) and uninstalled it again, using this "scorched earth" script:

#!/bin/bash
/usr/bin/sudo rm -rf $HOME/.rvm $HOME/.rvmrc /etc/rvmrc 
/etc/profile.d/rvm.sh /usr/local/rvm /usr/local/bin/rvm
/usr/bin/sudo /usr/sbin/groupdel rvm
/bin/echo "RVM is removed. Please check all .bashrc|.bash_profile|.profile|.zshrc for RVM source lines and delete or comment out if this was a Per-User installation."`

(I found this script here. I also tried more milquetoast approaches such as rvm implode and rm -rf ~/.rvm, etc.)

Now

$ which rvm

returns nothing, but rvm still seems to be there in some form, because when I type

$ rvm implode

I get a reaction, specifically:

cat: /Users/lolan/.rvm/VERSION: No such file or directory Warning! PATH is not properly set up, '/Users/lolan/.rvm/gems/ruby-2.3.1/bin' is not available. Usually this is caused by shell initialization files. Search for 'PATH=...' entries. You can also re-add RVM to your profile by running: 'rvm get stable --auto-dotfiles'. To fix it temporarily in this shell session run: 'rvm use ruby-2.3.1'. To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file. -bash: /Users/lolan/.rvm/scripts/base: No such file or directory -bash: /Users/lolan/.rvm/scripts/functions/implode: No such file or directory Are you SURE you wish for rvm to implode? This will recursively remove /Users/lolan/.rvm and other rvm traces? (anything other than 'yes' will cancel) > Psychologist intervened, cancelling implosion, crisis avoided :)

(This time I typed return when it prompted me for 'yes'. Other times I typed 'yes'.)

Basically, I'm mystified how $ which rvm returns nothing, but $ rvm implode doesn't return "command not found". This goes contrary to what I think I understand about the command line...

Anyway, how do I really kill RVM, together with its psychologist and all? :)

PS: I'm on macOS 10.12.

==============

UPDATE: It seems that despite having gone through all the standards steps for removing RVM (see above) and despite refreshing the shell (à la source .bash_profile, source .bashrc, source .profile), the shell was still keeping some memory, somehow, of RVM, that went away when I started a brand new shell.

I'd still like to understand better how/what the shell was keeping around, because keeping bits and pieces of script folders (after the script folder in question has been deleted!?!?) seems dangerous and counterintuitive to me.

Labrador
  • 447
  • 3
  • 11

1 Answers1

0

That's because rvm is in a hidden directory in your home directory and not in your PATH. which searches for an executable or script in the directories listed in the environment variable PATH using the same algorithm as bash. If it doesn't find it then it won't be returned.

If you want to know how to remove RVM there is already an answer for that. The easiest way is: rm -rf ~/.rvm

anothermh
  • 6,482
  • 3
  • 20
  • 39
  • As stated in my question, I already did `rm -rf ~/.rvm`. The link you point to was also referenced in my question already. In any case, I just checked again that `rm ~/.rvm` does not change the result. Next time please read the question more carefully. – Labrador Nov 11 '17 at 09:06
  • By the way, if `~/.abc` is a hidden folder, does typing `abc xyz` at the command line send the shell looking for script "xyz" somwhere in the ~/.abc directory? Even if the ~/.rvm folder had still been around (which it wasn't), I don't understand the mechanism by which `rvm` would be treated as an executable command... can you explain? – Labrador Nov 11 '17 at 13:06
  • 1
    Check [binary vs function mode](https://rvm.io/workflow/scripting). rvm loads as a shell function. – anothermh Nov 11 '17 at 22:27