bash 通过 RVM 安装 Ruby 1.9.2 失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3695608/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installing Ruby 1.9.2 through RVM fails
提问by Kevin Sj?berg
I installed RVM following the official guide on rvm. I installed Ruby 1.8.7 with rvm install 1.8.7and then set it as default with rvm 1.8.7 --default.
我按照rvm上的官方指南安装了 RVM 。我安装了 Ruby 1.8.7,rvm install 1.8.7然后使用rvm 1.8.7 --default.
Then I tried to install 1.9.2 with rvm install 1.9.2, and also tried rvm install 1.9.2-head. Everything went fine until I got to the "ruby-1.9.2-head - #installing-part".
然后我尝试用 安装 1.9.2 rvm install 1.9.2,也尝试过rvm install 1.9.2-head. 一切都很顺利,直到我到达“ruby-1.9.2-head - #installing-part”。
Then I got a huge error list complaining about my *nix bash commands:
然后我收到了一个巨大的错误列表,抱怨我的 *nix bash 命令:
/Home/kevin/.rvm/scripts/Manager: line 1760: sed: command not found
/Home/kevin/.rvm/scripts/Manager: line 1762: mv: command not found
/Home/kevin/.rvm/scripts/Manager: line 1762: chmod: command not found
/Home/kevin/.rvm/scripts/Manager: line 1632: cp: command not found
/Usr/bin/env: bash: The file or directory does not exist
/Home/kevin/.rvm/scripts/utilities: line 233: mkdir: command not found
/Home/kevin/.rvm/scripts/utilities: line 237: date: command not found
/Usr/bin/env: bash: The file or directory does not exist
/Usr/bin/env: bash: The file or directory does not exist
/Home/kevin/.rvm/scripts/utilities: line 233: mkdir: command not found
/Home/kevin/.rvm/scripts/utilities: line 237: date: command not found
/Usr/bin/env: bash: The file or directory does not exist
/Home/kevin/.rvm/scripts/Manager: line 1736: mkdir: command not found
/Home/kevin/.rvm/scripts/Manager: line 1738: ln: command not found
/Home/kevin/.rvm/scripts/Manager: line 1760: sed: command not found
/Home/kevin/.rvm/scripts/Manager: line 1762: mv: command not found
/Home/kevin/.rvm/scripts/Manager: line 1762: chmod: command not found
/Home/kevin/.rvm/scripts/Manager: line 1760: sed: command not found
/Home/kevin/.rvm/scripts/Manager: line 1762: mv: command not found
/Home/kevin/.rvm/scripts/Manager: line 1762: chmod: command not found
/Usr/bin/env: bash: The file or directory does not exist
/Home/kevin/.rvm/scripts/utilities: line 233: mkdir: command not found
/Home/kevin/.rvm/scripts/utilities: line 237: date: command not found
/Usr/bin/env: bash: The file or directory does not exist
/Usr/bin/env: bash: The file or directory does not exist
/Home/kevin/.rvm/scripts/Manager: line 1562: cp: command not found
/Home/kevin/.rvm/scripts/Manager: line 1573: chmod: command not found
/Home/kevin/.rvm/scripts/Manager: line 1562: cp: command not found
/Home/kevin/.rvm/scripts/Manager: line 1573: chmod: command not found
/Home/kevin/.rvm/scripts/Manager: line 1562: cp: command is not
/Home/kevin/.rvm/scripts/Manager: line 1573: chmod: command not found
/Home/kevin/.rvm/scripts/Manager: line 1562: cp: command not found
/Home/Kevin/.rvm/scripts/Manager: line 1573: chmod: command not found
/Home/kevin/.rvm/scripts/Manager: line 1562: cp: command not found
/Home/kevin/.rvm/scripts/Manager: line 1573: chmod: command not found
/Home/kevin/.rvm/scripts/Manager: line 1562: cp: command not found
/Home/kevin/.rvm/scripts/Manager: line 1573: chmod: command not found
/Home/kevin/.rvm/scripts/Manager: line 1562: cp: command not found
/Home/kevin/.rvm/scripts/Manager: line 1573: chmod: command not found
/Usr/bin/env: bash: The file or directory does not exist
/Home/kevin/.rvm/scripts/utilities: line 276: mkdir: command not found
/Home/kevin/.rvm/scripts/utilities: line 280: date: command not found
/Usr/bin/env: bash: The file or directory does not exist
/Home/kevin/.rvm/scripts/utilities: line 656: cp: command not found
/Usr/bin/env: bash: The file or directory does not exist
If I enter rvm 1.9.2 --defaultI get the same error output and my $PATHvariable is completely cleared.
如果我输入,rvm 1.9.2 --default我会得到相同的错误输出并且我的$PATH变量被完全清除。
Does anyone have a solution on this problem?
有没有人有这个问题的解决方案?
回答by Pragnesh Vaghela
To reinstall and start fresh remove RVM, just do rm -rfv ~/.rvmand also rm ~/.rvmrcif it's there.
要重新安装并重新开始删除 RVM,只需执行rm -rfv ~/.rvm,rm ~/.rvmrc如果它在那里。
Maybe "Install Rails 3 on OSX with RVM" will help you.
也许“使用 RVM 在 OSX 上安装 Rails 3”会帮助你。
回答by calas
I have the same problem, it looks like the whole RVM script is broken. The rvm install reecommand didn't fail but when running rvm use reeI started getting problems.
我有同样的问题,看起来整个 RVM 脚本都坏了。该rvm install ree命令没有失败,但是在运行时rvm use ree我开始遇到问题。
The $PATHvariable is not empty, like with rvm use 1.9.2, but it missed some important paths like /binand /usr/bin.
该$PATH变量不为空,像rvm use 1.9.2,但它错过了一些重要的路径,像/bin和/usr/bin。
Here is an example console session:
这是一个示例控制台会话:
calas@chamonix:~$ ls
Desktop dev Documents ...
calas@chamonix:~$ rvm use ree
info: Using /home/calas/.rvm/gems/ree-1.8.7-2010.02
calas@chamonix:~$ ls
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found
calas@chamonix:~$ rvm info
Command 'sed' is available in '/bin/sed'
The command could not be located because '/bin' is not included in the PATH environment variable.
sed: command not found
bash: grep: No such file or directory
bash: mkdir: No such file or directory
bash: grep: No such file or directory
/usr/bin/env: bash: No such file or directory
After running rvm infothe $PATHvariable is empty.
运行后rvm info的$PATH变量为空。
I removed the whole RVM installation with rvm implodeand reinstalled but that didn't work.
我删除了整个 RVM 安装rvm implode并重新安装,但这不起作用。
I guess the solution is to downgrade or wait for a new release.
我想解决方案是降级或等待新版本。
The solution is ready in the git source:
解决方案在git源码中已经准备好了:
rvm update --head && rvm reload
and problem solved, thanks Wayne!
问题解决了,谢谢韦恩!
回答by Jeet
Maybe "How to install Ruby on Rails in Ubuntu 11.10" will help you.
也许“如何在 Ubuntu 11.10 中安装 Ruby on Rails”会对您有所帮助。
回答by gMale
Something like this just happened to me and, upon closer inspection, I was just missing /user/binon my path. But why?
这样的事情刚刚发生在我身上,经过仔细检查,我只是/user/bin在路上失踪了。但为什么?
Turns out, after some investigation, I was missing a colon before $PATHand this caused the first directory in the default path (i.e. /user/bin) to get omitted.
事实证明,经过一番调查,我之前遗漏了一个冒号$PATH,这导致默认路径(即 /user/bin)中的第一个目录被省略。
Once I changed this:export PATH=$SCRIPTS:$WORKSPACE:$ANDROID_HOME:$HEROKU$PATH
to this:export PATH=$SCRIPTS:$WORKSPACE:$ANDROID_HOME:$HEROKU:$PATH
一旦我改变了这个:export PATH=$SCRIPTS:$WORKSPACE:$ANDROID_HOME:$HEROKU$PATH
到这个:export PATH=$SCRIPTS:$WORKSPACE:$ANDROID_HOME:$HEROKU:$PATH
(notice the colon added before the last '$')
Everything worked again. Obviously, your path will vary but check for missing colons.
(注意在最后一个 '$' 之前添加的冒号)
一切又恢复了。显然,您的路径会有所不同,但请检查是否缺少冒号。

