如何从我的系统中删除RVM (Ruby版本管理器)?
当前回答
注意,如果你通过apt-get安装RVM,你必须运行一些比RVM implode或apt-get remove ruby-rvm更深入的步骤来真正卸载它。
参见“在Ubuntu上安装RVM”。
其他回答
我运行的是Ubuntu 19.04,并且遵循了上面所有的说明。最后,对我有用的是跑步
sudo apt autoremove rvm
现在当我尝试重新安装RVM时,它实际上已经消失了。RVM至少可以说是侵入性的。
除了@tadman的回答,我删除了/usr/local/bin以及文件/etc/profile.d/rvm.中的包装器
包装材料包括:
erb
gem
irb
rake
rdoc
ri
ruby
testrb
根据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."
当使用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的故障排除页面包含此部分:
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."
推荐文章
- 是否可以在MiniTest中运行单个测试?
- 如何在Ruby中生成a和b之间的随机数?
- 无法安装gem -未能建立gem本地扩展-无法加载这样的文件——mkmf (LoadError)
- 如何在Ruby中创建文件
- 什么是Ruby文件。开放模式和选项?
- Ruby数组到字符串的转换
- 如何分割(块)一个Ruby数组成X元素的部分?
- Ruby中“or”和||的区别?
- 如何测试参数是否存在在轨道
- 库未加载:libmysqlclient.16。在OS X 10.6上使用mysql2 gem运行'rails server'时出现dylib错误
- 在Ruby中不创建新字符串而修饰字符串的规范方法是什么?
- RVM不是一个函数,用' RVM use…’不会起作用
- 了解Gemfile。锁文件
- 如何确定一个数组是否包含另一个数组的所有元素
- 是什么导致这个ActiveRecord::ReadOnlyRecord错误?