How can I remove RVM (Ruby Version Manager) from m

2018-12-31 15:19发布

How can I remove RVM (Ruby Version Manager) from my system?

10条回答
姐姐魅力值爆表
2楼-- · 2018-12-31 15:37

When using implode and you see:

Psychologist intervened, cancelling implosion, crisis avoided :)

Then you may want to use --force

rvm implode --force

Then remove rvm from following locations:

rm -rf /usr/local/rvm
sudo rm /etc/profile.d/rvm.sh
sudo rm /etc/rvmrc
sudo rm ~/.rvmrc

Check the following files and remove or comment out references to rvm

~/.bashrc 
~/.bash_profile 
~/.profile 
~/.zshrc
~/.zlogin

Comment-out / Remove the following lines from /etc/profile

 source /etc/profile.d/sm.sh
 source /etc/profile.d/rvm.sh

/etc/profile is a readonly file so use

sudo vim /etc/profile

And after making the change write using a bang!

:w!

Finally re-login / restart your terminal.

查看更多
路过你的时光
3楼-- · 2018-12-31 15:37

If you're still getting a env: ruby_executable_hooks: No such file or directory when calling some Ruby package, that means RVM left a little gift for you in your $PATH.

Run the following to find the offending scripts:

grep '#!/usr/bin/env ruby_executable_hooks' /usr/local/bin/*

Then rm all the matches. You'll have to reinstall all of those libraries with an RVM-free gem, of course.

查看更多
君临天下
4楼-- · 2018-12-31 15:42

In addition to @tadman's answer I removed the wrappers in /usr/local/bin as well as the file /etc/profile.d/rvm.

The wrappers include:

erb
gem
irb
rake
rdoc
ri
ruby
testrb
查看更多
残风、尘缘若梦
5楼-- · 2018-12-31 15:42

Remove the RVM load script from /.bash_rc or /.zsh_rc, then use:

rm -rf /.rvm

Or:

rvm implode
查看更多
查无此人
6楼-- · 2018-12-31 15:46

Run the following command

rvm implode

Now you need to unistall the rvm gem:

gem uninstall rvm

Check if there are any remaining rvm files in your home directory, if yes remove them.

Go to the home directory and list all hidden files

ls -a

rm  .rvm
rm  .rvmrc
查看更多
低头抚发
7楼-- · 2018-12-31 15:47

A lot of people do a common mistake of thinking that 'rvm implode' does it . You need to delete all traces of any .rm files . Also , it will take some manual deletions from root . Make sure , it gets deleted and also all the ruby versions u installed using it .

查看更多
登录 后发表回答