How to remove RVM (Ruby Version Manager) from my system

前端 未结 12 1406
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 07:53

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

相关标签:
12条回答
  • 2020-11-22 08:11

    Note that if you installed RVM via apt-get, you have to run some further steps than rvm implode or apt-get remove ruby-rvm to get it to really uninstall.

    See "Installing RVM on Ubuntu".

    0 讨论(0)
  • 2020-11-22 08:13

    If the other answers don’t remove RVM throughly enough for you, RVM’s Troubleshooting page contains this section:

    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."
    
    0 讨论(0)
  • 2020-11-22 08:14

    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 .

    0 讨论(0)
  • 2020-11-22 08:17

    Run:

    rvm implode
    

    Now you need to uninstall the RVM gem using:

    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
    
    0 讨论(0)
  • 2020-11-22 08:22

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

    rm -rf /.rvm
    

    Or:

    rvm implode
    
    0 讨论(0)
  • 2020-11-22 08:23

    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
    
    0 讨论(0)
提交回复
热议问题