如何从我的系统中删除RVM (Ruby版本管理器)?


当前回答

Run:

rvm implode

现在你需要使用以下方法卸载RVM gem:

gem uninstall rvm

检查您的主目录中是否有剩余的RVM文件,如果有,删除它们。

进入主目录并列出所有隐藏文件:

ls -a

rm  .rvm
rm  .rvmrc

其他回答

很多人犯了一个常见的错误,认为是“rvm implode”做的。您需要删除任何.rm文件的所有痕迹。此外,它将从根目录中手动删除一些内容。确保它会被删除,你使用它安装的所有ruby版本也会被删除。

对于其他试图修复PATH变量的shell新手

在遵循已接受答案中的说明后,如果需要,检查并修改PATH变量:

env | grep PATH 

如果你在任何地方看到“rvm”,你需要弄清楚你在哪里设置PATH并修改。我把它设置在3个文件-所以检查所有以下文件:

vim .bashrc  

使用dd命令删除文件中引用rvm的行。:wq保存并退出。 Source .bashrc来“重载”

对.profile和.bash_profile重复这个过程(从vim命令开始)

根据RVM的故障排除文档“如何从系统中完全清除RVM的所有痕迹,包括系统范围的安装?”:

Here is a custom script which we name as 'cleanout-rvm'. While you can definitely use rvm implode as a regular user or rvmsudo rvm implode for a system wide install, this script is useful as it steps completely outside of RVM and cleans out RVM without using RVM itself, leaving no traces. #!/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."

Run:

rvm implode

现在你需要使用以下方法卸载RVM gem:

gem uninstall rvm

检查您的主目录中是否有剩余的RVM文件,如果有,删除它们。

进入主目录并列出所有隐藏文件:

ls -a

rm  .rvm
rm  .rvmrc

如果其他答案不能完全为您删除RVM, RVM的故障排除页面包含此部分:

How do I completely clean out all traces of RVM from my system, including for system wide installs? Here is a custom script which we name as cleanout-rvm. While you can definitely use rvm implode as a regular user or rvmsudo rvm implode for a system wide install, this script is useful as it steps completely outside of RVM and cleans out RVM without using RVM itself, leaving no traces. #!/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."