如何从我的系统中删除RVM (Ruby版本管理器)?
当前回答
我运行的是Ubuntu 19.04,并且遵循了上面所有的说明。最后,对我有用的是跑步
sudo apt autoremove rvm
现在当我尝试重新安装RVM时,它实际上已经消失了。RVM至少可以说是侵入性的。
其他回答
如果在调用Ruby包时仍然得到env: ruby_executable_hooks:没有这样的文件或目录,这意味着RVM在$PATH中为你留下了一个小礼物。
执行以下命令查找违规脚本:
grep '#!/usr/bin/env ruby_executable_hooks' /usr/local/bin/*
然后rm所有的匹配。当然,您必须使用RVM-free gem重新安装所有这些库。
如果其他答案不能完全为您删除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."
根据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."
有一个简单的内置命令可以拉出它:
rvm implode
这将删除rvm/目录以及其中构建的所有ruby。如果你安装了rvm gem,为了删除rvm的最终跟踪,你也需要删除rvm gem:
gem uninstall rvm
在家酿、Apt或DNF安装中可能会有剩余的元素需要移除。这取决于您一开始是如何安装它的。这个清理步骤是可选的,因为RVM将不再涉及Ruby,但可以帮助保持事情的组织。
如果你已经修改了你的PATH,你可能也想拉这些。检查你的.bashrc, .profile和.bash_profile文件。
你也可以有一个/etc/rvmrc文件,或者在你的主目录~/。RVMRC也可能需要切除。
我运行的是Ubuntu 19.04,并且遵循了上面所有的说明。最后,对我有用的是跑步
sudo apt autoremove rvm
现在当我尝试重新安装RVM时,它实际上已经消失了。RVM至少可以说是侵入性的。
推荐文章
- 在Ruby中输出数组到CSV
- 一行if语句不工作
- 在Ruby中将整数转换为十六进制字符串
- 如何记录Ruby代码?
- Ruby:包含的反义词是什么?Ruby数组?
- 在Ruby中,proc和lambda有什么区别?
- 如何传递参数到一个Rake任务与环境在Rails?
- 获取当前正在执行的方法的名称
- 如何在Rails中计算相对时间?
- 在Ruby中使用范围填充数组的正确方法
- “for”和“each”在Ruby中
- 我如何复制一个哈希在Ruby?
- Ruby/Rails:将Date转换为UNIX时间戳
- 我如何编码/解码HTML实体在Ruby?
- Ruby有一个string. startwith ("abc")内置方法吗?