安装 RVM 时出现问题
我已按照 rvm 网站上的说明执行了命令,但似乎不起作用。
从 git 存储库获取代码运行顺利,但当我尝试使用
rvm notes
Error:
/usr/local/bin/rvm: line 73: /home/cody/.rvm/scripts/rvm: No such file or directory
在多行中闪烁并且不会停止直到我按下 ctrl+C.. 我正在运行 Ubuntu 8.04,目前正在运行 ruby 1.9.2.. 抱歉,如果我遗漏了任何必要的信息。提前致谢。
I have executed the commands as prescribed in the instructions at the rvm website but things don't seem to work..
Fetching the code from the git repository runs smoothly but when I try to use
rvm notes
Error:
/usr/local/bin/rvm: line 73: /home/cody/.rvm/scripts/rvm: No such file or directory
flashes in multiple lines and doesn't stop till I hit ctrl+C..
I am running Ubuntu 8.04 and currently I am running ruby 1.9.2..
Sorry, if I am missing out any necessary information. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
嗯,我并不是想将此作为对问题的评论。无论如何,如果我不得不猜测,我会说您使用 sudo 或以 root 身份安装了 rvm。如果是这种情况,将其删除并重新安装(无需 sudo):
打开新的终端窗口/选项卡并确保 rvm被删除:
输出应该为空,有时需要重新登录,为空后您可以继续:
对于本地用户安装它工作得很好。
Ack, I didn't mean to post this as a comment on the question. Anyway, if I had to guess, I'd say you installed rvm using sudo or as root. If that is the case, remove it and reinstall without sudo:
Open new terminal window/tab and make sure rvm is removed:
The output should be empty, sometimes it's needed to relogin, after it's empty you can continue:
It works perfectly fine installed for the local user.
好的,对于任何尝试使用 sudo 安装 RVM 并且现在正在拉取的人
他们费尽心思地试图将其安装在
$HOME/.rvm
中,这就是为我做的:
当您使用
sudo
安装 RVM 时,它创建了一个文件/etc/rvmrc
,其中包含以下内容:这使得以后所有的安装尝试(即使在不作为 sudo 运行)
安装到 /usr/local/rvm 中,这不是您想要的单个
用户安装。因此,删除
/etc/rvmrc
然后您可以运行它,它将正确安装到
$HOME/.rvm
Ok, for anyone who tried to install RVM using sudo and is now pulling
their hair out trying to get it to install in
$HOME/.rvm
, here's whatdid it for me:
When you installed RVM using
sudo
, it created a file/etc/rvmrc
, which contains the following:This makes all future attempts at installation (even when not run as sudo)
install into /usr/local/rvm, which is NOT what you want for a single
user installation. So remove
/etc/rvmrc
and then you can runand it will install properly into
$HOME/.rvm
您是否将此行添加到您的
~/.bashrc
中?DId you add this line to your
~/.bashrc
?哪个命令?有几个页面包含安装 RVM 的说明,具体取决于您是否需要单用户“沙箱” 或以管理员身份为多用户系统安装系统范围。
因为您的 RVM 位于
/usr/local
中,所以我认为您尝试进行系统范围的安装,但没有得到正确的结果。对于 99% 的人来说,这是错误的安装方法,您应该使用单用户安装,这很简单,并将所有内容都放在~/.rvm
中。无论哪种方式,请务必阅读整个说明。并且,如果进行单用户安装,请通过对单用户的
~/.bashrc
或~/.bash_profile
进行“安装后”修改来完成安装,然后启动一个新的终端会话。使用单用户安装时切勿使用 sudo 将 gems 安装到 RVM 管理的 Ruby,即使宝石的说明可能会这样说。
WHICH commands? There are several pages containing instructions to install RVM depending on whether you want a single-user "sandbox" or are installing system-wide for a multi-user system as the administrator.
Because you have RVM in
/usr/local
, I think you tried to do a system-wide install but didn't get it right. For 99% of us, that is the wrong installation method, and instead you should use the single-user installation, which is simple and puts everything in~/.rvm
.Either way, be sure to read the entire instructions. And, if doing a single-user install, finish the install with the "Post Install" modifications to
~/.bashrc
or~/.bash_profile
for a single-user, then start a new terminal session.When using the single-user install NEVER use sudo to install gems to a RVM-managed Ruby, even though the instructions for a gem might say to.
请参阅此处的“安装疑难解答”部分。由于您使用的是 Ubuntu,您可能需要对 .bashrc 进行进一步的修改
Look at the section "Troubleshooting your install" here. Since you are on Ubuntu, you probably need to make further mods to you .bashrc
在 .bashrc 中,您是否更改了
[ -z "$PS1" ] &&返回
到
if [[ -n "$PS1" ]];然后
并将其添加到文件末尾:
fi
[[ -s "$HOME/.rvm/scripts/rvm" ]] &&源“$HOME/.rvm/scripts/rvm”
in .bashrc have you changed the
[ -z "$PS1" ] && return
to
if [[ -n "$PS1" ]]; then
and added this to the end of the file:
fi
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
我只是遇到了类似的问题。
结果发现 ~/.rvm/scripts/ 和 ~/.rvm/src/rvm/scripts/ 中的许多显然应该是可执行的文件没有执行权限。在两个目录上运行脚本将所有文件设置为可执行文件解决了这个迫在眉睫的问题。
I just had a similar problem.
It turned out that many files in ~/.rvm/scripts/ and ~/.rvm/src/rvm/scripts/ which obviously should be executable did not have execute permissions. Running a script on both directories to set all files to executable solved that immediate problem.
我安装后也遇到同样的问题。然后我重新启动终端,它开始正常工作。
I have got same problem after installation. Then I restarted terminal and it started working poperly.