无法卸载RVM的问题

10

我正在运行Ubuntu 10.04 Lucid,我可能错误地卸载了RVM,现在它似乎没有完全从系统中删除。现在我想再次安装,但遇到了麻烦。

问题是当我尝试执行一些命令时,会生成奇怪的输出:

# Note that following command lines don't output the version
# (between the word "version" and the word "is") as it should be.

$ rvm
$ rvm -v
> -bash: /usr/local/rvm/scripts/base: No such file or directory
> A RVM version  is installed yet 1.10.3 is loaded.
>  Please do one of the following:
>   * 'rvm reload'
>   * open a new shell


# Even if I use the 'cd' command I have problems...

$ cd ..
> -bash: /usr/local/rvm/scripts/initialize: No such file or directory
> -bash: /usr/local/rvm/scripts/hook: No such file or directory

这可能意味着即使Ruby似乎正在运行,RVM仍未被正确删除:
$ which ruby
/usr/local/bin/ruby
$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]

那么,我该如何完全删除/卸载RVM呢?


更新

我解决了部分问题(或者说是所有问题):那个(或那些)问题与Phusion Passenger有关,它仍在加载由RVM管理的旧路径相关的Ruby版本。

3个回答

9

首先尝试执行 echo $rvm_path 命令,如果显示了任何结果,就请执行 rm -rf 命令将其删除。

第二步:

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

下一步检查 ls -l /usr/local/bin | grep rvm,这将显示指向rvm的链接- rm -rf它们

最后,运行which rvm - 如果它显示任何内容,请尝试检查此路径并删除至少此文件。


1
+1 对于 /etc/rvmrc,我不得不注销并重新登录用户以消除 cd 消息(请参见原始帖子)。 - Niloct

6

那个文件夹在我的系统上不存在(可能是因为我正在运行Ubuntu)。 - Backo
在终端中运行命令“rvm info”以查找路径并查看rvm的安装位置。 - asitmoharna
@ - 所以,我有这个 环境变量: PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/rvm/bin"。现在,我该如何移除 RVM? - Backo
rvm没有正确安装。尝试重新启动系统并重新安装rvm。如果您在此处列出您的rvm列表和rvm信息,将有所帮助。 - asitmoharna

1

来自 rvm help

implode  - (seppuku) removes the rvm installation completely.
           This means everything in $rvm_path (~/.rvm || /usr/local/rvm).
           This does not touch your profiles. However, this means that you
           must manually clean up your profiles and remove the lines which source RVM.

根据你的$PATH,你也可以(另外)删除以下所有文件和目录:
  • /usr/local/rvm
  • /etc/rvmrc
  • /etc/profile.d/rvm.sh

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接