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


当前回答

注意,如果你通过apt-get安装RVM,你必须运行一些比RVM implode或apt-get remove ruby-rvm更深入的步骤来真正卸载它。

参见“在Ubuntu上安装RVM”。

其他回答

我运行的是Ubuntu 19.04,并且遵循了上面所有的说明。最后,对我有用的是跑步

sudo apt autoremove rvm

现在当我尝试重新安装RVM时,它实际上已经消失了。RVM至少可以说是侵入性的。

如果其他答案不能完全为您删除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."

Run:

rvm implode

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

gem uninstall rvm

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

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

ls -a

rm  .rvm
rm  .rvmrc

如果在调用Ruby包时仍然得到env: ruby_executable_hooks:没有这样的文件或目录,这意味着RVM在$PATH中为你留下了一个小礼物。

执行以下命令查找违规脚本:

grep '#!/usr/bin/env ruby_executable_hooks' /usr/local/bin/*

然后rm所有的匹配。当然,您必须使用RVM-free gem重新安装所有这些库。

从/中删除RVM加载脚本。Bash_rc或/。Zsh_rc,然后使用:

rm -rf /.rvm

Or:

rvm implode