如何从我的系统中删除RVM (Ruby版本管理器)?
当前回答
如果其他答案不能完全为您删除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."
其他回答
如果在调用Ruby包时仍然得到env: ruby_executable_hooks:没有这样的文件或目录,这意味着RVM在$PATH中为你留下了一个小礼物。
执行以下命令查找违规脚本:
grep '#!/usr/bin/env ruby_executable_hooks' /usr/local/bin/*
然后rm所有的匹配。当然,您必须使用RVM-free gem重新安装所有这些库。
除了@tadman的回答,我删除了/usr/local/bin以及文件/etc/profile.d/rvm.中的包装器
包装材料包括:
erb
gem
irb
rake
rdoc
ri
ruby
testrb
Run:
rvm implode
现在你需要使用以下方法卸载RVM gem:
gem uninstall rvm
检查您的主目录中是否有剩余的RVM文件,如果有,删除它们。
进入主目录并列出所有隐藏文件:
ls -a
rm .rvm
rm .rvmrc
我运行的是Ubuntu 19.04,并且遵循了上面所有的说明。最后,对我有用的是跑步
sudo apt autoremove rvm
现在当我尝试重新安装RVM时,它实际上已经消失了。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不是一个函数,用' RVM use…’不会起作用
- 了解Gemfile。锁文件
- 如何确定一个数组是否包含另一个数组的所有元素
- 是什么导致这个ActiveRecord::ReadOnlyRecord错误?
- 最好的打印散列的方法
- Rails:dependent =>:destroy VS:dependent =>:delete_all
- 我可以在不包含Ruby模块的情况下调用实例方法吗?
- 如何将新项目添加到哈希
- 测试一个Ruby类是否是另一个类的子类
- 什么时候使用Struct vs. OpenStruct?
- 数组到哈希Ruby
- 我如何让红宝石打印一个完整的回溯而不是截断一个?
- 如何使用RSpec的should_raise与任何类型的异常?
- 如何创建退出消息
- 忽略GEM,因为没有构建它的扩展