如何从我的系统中删除RVM (Ruby版本管理器)?
当前回答
根据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的所有痕迹,包括系统范围的安装?”:
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."
注意,如果你通过apt-get安装RVM,你必须运行一些比RVM implode或apt-get remove ruby-rvm更深入的步骤来真正卸载它。
参见“在Ubuntu上安装RVM”。
当使用implode时,你会看到:
Psychologist intervened, cancelling implosion, crisis avoided :)
那你可能会想用武力
rvm implode --force
然后从以下位置移除RVM:
rm -rf /usr/local/rvm
sudo rm /etc/profile.d/rvm.sh
sudo rm /etc/rvmrc
sudo rm ~/.rvmrc
检查以下文件,删除或注释掉对RVM的引用:
~/.bashrc
~/.bash_profile
~/.profile
~/.zshrc
~/.zlogin
注释/删除/etc/profile中的以下行:
source /etc/profile.d/sm.sh
source /etc/profile.d/rvm.sh
/etc/profile是一个只读文件,所以使用:
sudo vim /etc/profile
在做出改变后,使用bang来写!
:w!
最后重新登录/重新启动您的终端。
有一个简单的内置命令可以拉出它:
rvm implode
这将删除rvm/目录以及其中构建的所有ruby。如果你安装了rvm gem,为了删除rvm的最终跟踪,你也需要删除rvm gem:
gem uninstall rvm
在家酿、Apt或DNF安装中可能会有剩余的元素需要移除。这取决于您一开始是如何安装它的。这个清理步骤是可选的,因为RVM将不再涉及Ruby,但可以帮助保持事情的组织。
如果你已经修改了你的PATH,你可能也想拉这些。检查你的.bashrc, .profile和.bash_profile文件。
你也可以有一个/etc/rvmrc文件,或者在你的主目录~/。RVMRC也可能需要切除。
推荐文章
- 库未加载:libmysqlclient.16。在OS X 10.6上使用mysql2 gem运行'rails server'时出现dylib错误
- 在Ruby中不创建新字符串而修饰字符串的规范方法是什么?
- RVM不是一个函数,用' RVM use…’不会起作用
- 了解Gemfile。锁文件
- 如何确定一个数组是否包含另一个数组的所有元素
- 是什么导致这个ActiveRecord::ReadOnlyRecord错误?
- 最好的打印散列的方法
- Rails:dependent =>:destroy VS:dependent =>:delete_all
- 我可以在不包含Ruby模块的情况下调用实例方法吗?
- 如何将新项目添加到哈希
- 测试一个Ruby类是否是另一个类的子类
- 什么时候使用Struct vs. OpenStruct?
- 数组到哈希Ruby
- 我如何让红宝石打印一个完整的回溯而不是截断一个?
- 如何使用RSpec的should_raise与任何类型的异常?