安装 RVM 时出现问题

发布于 2024-10-16 21:41:50 字数 330 浏览 1 评论 0原文

我已按照 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

堇色安年 2024-10-23 21:41:51

嗯,我并不是想将此作为对问题的评论。无论如何,如果我不得不猜测,我会说您使用 sudo 或以 root 身份安装了 rvm。如果是这种情况,将其删除并重新安装(无需 sudo):

sudo rm -rf $HOME/.rvm $HOME/.rvmrc /etc/rvmrc /etc/profile.d/rvm.sh \
  /usr/local/rvm /usr/local/bin/rvm
sudo /usr/sbin/groupdel rvm # this might fail, it's not that important

打开新的终端窗口/选项卡并确保 rvm被删除:

env | grep rvm

输出应该为空,有时需要重新登录,为空后您可以继续:

curl -sSL https://get.rvm.io | bash -s stable

对于本地用户安装它工作得很好。

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:

sudo rm -rf $HOME/.rvm $HOME/.rvmrc /etc/rvmrc /etc/profile.d/rvm.sh \
  /usr/local/rvm /usr/local/bin/rvm
sudo /usr/sbin/groupdel rvm # this might fail, it's not that important

Open new terminal window/tab and make sure rvm is removed:

env | grep rvm

The output should be empty, sometimes it's needed to relogin, after it's empty you can continue:

curl -sSL https://get.rvm.io | bash -s stable

It works perfectly fine installed for the local user.

苦妄 2024-10-23 21:41:51

好的,对于任何尝试使用 sudo 安装 RVM 并且现在正在拉取的人
他们费尽心思地试图将其安装在 $HOME/.rvm 中,这就是
为我做的:

当您使用 sudo 安装 RVM 时,它创建了一个文件 /etc/rvmrc,其中包含以下内容:

umask g+w  
export rvm_path="/usr/local/rvm"  

这使得以后所有的安装尝试(即使在不作为 sudo 运行)
安装到 /usr/local/rvm 中,这不是您想要的单个
用户安装。因此,删除 /etc/rvmrc 然后您可以运行它

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)  

,它将正确安装到 $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 what
did it for me:

When you installed RVM using sudo, it created a file /etc/rvmrc, which contains the following:

umask g+w  
export rvm_path="/usr/local/rvm"  

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 run

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)  

and it will install properly into $HOME/.rvm

宁愿没拥抱 2024-10-23 21:41:51

您是否将此行添加到您的 ~/.bashrc 中?

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.

DId you add this line to your ~/.bashrc?

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
相思碎 2024-10-23 21:41:51

我已按照rvm网站上的说明执行了命令。

哪个命令?有几个页面包含安装 RVM 的说明,具体取决于您是否需要单用户“沙箱” 或以管理员身份为多用户系统安装系统范围

因为您的 RVM 位于 /usr/local 中,所以我认为您尝试进行系统范围的安装,但没有得到正确的结果。对于 99% 的人来说,这是错误的安装方法,您应该使用单用户安装,这很简单,并将所有内容都放在 ~/.rvm 中。

无论哪种方式,请务必阅读整个说明。并且,如果进行单用户安装,请通过对单用户的 ~/.bashrc~/.bash_profile 进行“安装后”修改来完成安装,然后启动一个新的终端会话。

使用单用户安装时切勿使用 sudo 将 gems 安装到 RVM 管理的 Ruby,即使宝石的说明可能会这样说。

I have executed the commands as prescribed in the instructions at the rvm website.

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.

错々过的事 2024-10-23 21:41:51

请参阅此处的“安装疑难解答”部分。由于您使用的是 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

So尛奶瓶 2024-10-23 21:41:51

在 .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"

你的背包 2024-10-23 21:41:51

我只是遇到了类似的问题

结果发现 ~/.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.

凌乱心跳 2024-10-23 21:41:51

我安装后也遇到同样的问题。然后我重新启动终端,它开始正常工作。

I have got same problem after installation. Then I restarted terminal and it started working poperly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文