我正在关注此guide以删除rvm,并想知道我应该在.bashrc
,.profile
和.bash_profile
文件中删除哪些内容。我手动删除了/.rvm
,但找不到.profile
。这些是我在.bashrc
和.bash_profile
中的路径:
的.bashrc
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
我需要删除任何东西吗?也许是第一线?
的.bash_profile
export PATH=/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/Users/user/.rvm/gems/ruby-2.1.1/bin:/Users/user/.rvm/gems/ruby-2.1.1@global/bin:/Users/user/.rvm/rubies/ruby-2.1.1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/user/.rvm/bin:/Users/connorphillips/mongodb/bin
我应该删除所有这些吗?
答案 0 :(得分:0)
删除.bashrc
整行:
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
编辑.bash_profile
行以仅删除RVM路径,因此您的行变为:
export PATH=/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/connorphillips/mongodb/bin
您的特定系统可能没有.profile
文件,这很好。
这是我为所有用户删除整个系统的RVM的脚本。
https://github.com/SixArm/sixarm_unix_shell_scripts/blob/master/rvm-uninstall-danger
#!/bin/bash
#
# Uninstall RVM (Ruby Version Manager). THIS IS DANGEROUS.
#
# This runs rvm implode, delete RVM files from the system,
# deletes /home/*/.rvmrc files and /home/*/.rvm directories,
# and uninstalls all RVM gems. We run this script as root.
#
# Adjust as you like for your needs.
#
# Some of the script lines may report missing directories.
# For example, a Mac system typically has a /Users/ directory,
# whereas a Linux system typically has a /home/ directory.
# You can delete the lines that you don't need, if you like.
#
# If rvm implode gives errors like this loop:
#
# line 72: /usr/local/rvm/scripts/rvm: No such file or directory
#
# then the rvm setup is bonked and we can delete the rvm script
# by hand then run this script again; rvm implode won't work,
# but the rest of the script will do a decent job of deleting
# any lingering rvm files and reporting any remainders.
#
# Author: Joel Parker Henderson (joel@joelparkerhenderson.com)
# License: GPL
#
set -o nounset
set -o errexit
set -o pipefail
echo "rvm implode"
rvm implode
echo "remove rvm files from system-wide areas"
sudo rm -rf /usr/local/bin/rvm
sudo rm -rf /usr/local/rvm
sudo rm -rf /etc/rvmrc
sudo rm -rf /etc/profile.d/rvm.sh
echo "remove rvm files from all likely user areas"
sudo rm -rf /home/*/.rvmrc
sudo rm -rf /home/*/.rvm
sudo rm -rf /Users/*/.rvmrc
sudo rm -rf /Users/*/.rvm
echo "remove rvm files from the current user's home"
sudo rm -rf $HOME/.rvmrc
sudo rm -rf $HOME/.rvm
echo "uninstall rvm gem"
gem uninstall -a -q rvm
echo "delete rvm group"
sudo /usr/sbin/groupdel rvm
echo "try to find any remaining .rvmrc files to delete by hand"
find -L / -name .rvmrc
echo "try to find rvm text in configuration files to edit by hand"
find -L / -type f | grep "\(bash_login\|bash_profile\|bashrc\|profile\|zshenv\|zshrc\|zlogin\|zlogout\|zprofile\)$" | xargs -I{} grep -Iil "rvm" {}