简体   繁体   English

安装RVM后找不到RVM

[英]RVM not found, after installing RVM

I've found a couple similar posts regarding this same problem, but none of the solutions seem to apply, here. 我找到了几个关于同样问题的类似帖子,但这里没有一个解决方案似乎适用。

On a fresh Ubuntu 10.10 install, I follow the instructions for installing RVM: 在新的Ubuntu 10.10安装上,我按照安装RVM的说明进行操作:

$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

Then I create .bash_profile and add the following line: 然后我创建.bash_profile并添加以下行:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

I restart the terminal and check RVM: 我重新启动终端并检查RVM:

$ type rvm | head -1
-bash: type: rvm: not found

As the RVM installation guide explains to do so, I replaced the first line (below) in .bashrc with the second one, then indented everything in the rest of the file and added a fi. 正如RVM安装指南所解释的那样,我将.bashrc中的第一行(下面)替换为第二行,然后在文件的其余部分中缩进所有内容并添加了一个fi。

[ -z "$PS1" ] && return     # original
if [[ -n "$PS1" ]]; then    # replaced with this

Restarted terminal and still, no luck. 重启终端仍然没有运气。

Then, I removed the line I added to .bash_profile in the beginning and added it to .bashrc, even though that isn't what the guide said to do. 然后,我删除了我在开头添加到.bash_profile的行,并将其添加到.bashrc,即使这不是指南所说的。 Still, no luck. 不过,没有运气。 I also entered it directly on the command line, with no change in behavior. 我也直接在命令行输入它,行为没有变化。 When I run .rvm from ~/.rvm/bin/rvm it complains that there is no such file or directory as /.rvm/scripts/rvm and that the command was not fund. 当我从〜/ .rvm / bin / rvm运行.rvm时,它抱怨没有像/.rvm/scripts/rvm这样的文件或目录,并且该命令不是资金。

Of course, there isn't any such "scripts" directory inside of ./rvm, either -- so I'm not sure why it's looking for one? 当然,./rvm中也没有任何这样的“脚本”目录 - 所以我不确定它为什么要找一个? The only directories inside of .rvm are .rvm中唯一的目录是

archives
bin
config
gems
gemsets
log
man
rubies
src
tmp
user

The only thing I've found while googling for answers are other people complaining of similar problems and people telling them to add the instructed line to .bash_profile (which I obviously already did). 我在google搜索答案时发现的唯一一件事就是其他人抱怨类似的问题,人们告诉他们将指示行添加到.bash_profile(我显然已经这样做了)。 At this point, I have nothing more to go on and am at an impasse. 在这一点上,我没有更多的事情可以继续下去,陷入僵局。

Regards. 问候。

Resolution: As Andrew Marshall advised in his comments, below, I did an 'rm -rf .rvm' and reinstalled rvm. 解决方案:正如Andrew Marshall在下面的评论中所说,我做了一个'rm -rf .rvm'并重新安装了rvm。 I had actually attempted this two times before posting here, with the same results every time. 在发布之前,我实际上已尝试了两次,每次都有相同的结果。 No odd messages in the install log, but no /scripts/ directory, either. 安装日志中没有奇怪的消息,但是没有/ scripts /目录。 Just so I could say I had , I did it a third time at Andrew's urging. 就这样我可以说我 ,我在安德鲁的催促下第三次这样做了。 This time, I checked and the /scripts/ directory existed. 这一次,我检查了/ scripts /目录。 Running 'type rvm | 运行'type rvm | head -1' confirmed it as a 'function' and I can now move on. head -1'确认它是一个'功能',我现在可以继续前进。

Make sure that you restart a session after reinstalling, so that rvm is in your path. 确保在重新安装后重新启动会话,以便rvm在您的路径中。

You can try to logout/login. 您可以尝试注销/登录。

You can also open your shell as a login shell. 您还可以将shell作为登录shell打开。 Under ubuntu 12.04: 在ubuntu 12.04下:

  • Open a terminal 打开一个终端
  • Edit > Profile Preferences Edit > Profile Preferences
  • Under tab Title and Command, check run Command as a login shell 在选项卡标题和命令下,选中run Command as a login shell
  • Open new terminal ( ctrl+alt+t ) and type rvm 打开新终端( ctrl+alt+t )并输入rvm

If there's no scripts directory inside .rvm , it would seem that RVM failed to successfully complete installation. 如果.rvm没有scripts目录,则RVM似乎无法成功完成安装。 Delete the .rvm directory, try reinstalling, and look at the installation output closely to see if it's complaining about anything. 删除.rvm目录,尝试重新安装,并仔细查看安装输出,看看它是否在抱怨任何事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM