Made a mistake installing RVM with sudo. How to re

2019-04-02 02:51发布

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?

3条回答
你好瞎i
2楼-- · 2019-04-02 03:23

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.

查看更多
仙女界的扛把子
3楼-- · 2019-04-02 03:34

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
查看更多
放我归山
4楼-- · 2019-04-02 03:36

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.

查看更多
登录 后发表回答