Made a mistake installing RVM with sudo. How to reverse?

末鹿安然 提交于 2019-12-12 08:16:28

问题


I am new to Rails and Linux and have installed RVM with sudo.

sudo bash -s stable < <(curl -s https://raw.github/wayneeseguin/rvm/master/binscripts/rvm-installer)

Now I have to run most commands (like spork) with 'rvmsudo'. It is redundant, and the way I learned, when something is redundand it is often wrong. How to get rid of this nuance? Is the only way to reinstall RVM? If so, how to properly reinstall?


回答1:


Use rvm implode to uninstall rvm. Check that there are no environment variables left over in /etc/profile, /etc/bash_profile or whatever shell you're using. Once you do that, then re-install using the single user guide found here.

You'll have to execute the implode command using sudo since you installed it as root.




回答2:


1)remove in home directory:

rm -rf .rvm*

2)remove from your bash file:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

3) remove from /etc/rvmrc file

sudo rm -rf /etc/rvm*

4)Delete everything else

sudo groupdel rvm



回答3:


I couldn't find a complete/concise step-by-step to 100% remove rvm when it was run as root. Here's what I came up with, and I've tested it three times successfully:

sudo su -
rvm implode
groupdel rvm
rm /etc/rvmrc
rm /etc/profile.d/rvm.sh

You'll also want to double check that you don't have ~/.rvm or ~/.rvmrc or any rvm whatnot in your .bashrc (possibly .bash_profile on OSx), as you've likely been trying to install rvm several ways by this point!

Next, you'll need to reboot, as the global environment variables set in /etc/profile.d/rvm.sh will keep getting populated in new shells until you do. After rebooting, open a terminal and try this command to test:

echo $rvm_path

If it's empty, that means you've succeeded! If not, it'll most likely be set to /usr/local/rvm.



来源:https://stackoverflow.com/questions/9932125/made-a-mistake-installing-rvm-with-sudo-how-to-reverse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!