ruby RVM 安装失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8612067/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 04:36:27  来源:igfitidea点击:

RVM installation fails

rubyrvm

提问by Andrzej Gis

I followed the instructions from the RVM homepage (https://rvm.beginrescueend.com/rvm/install/)

我按照 RVM 主页 (https://rvm.beginrescueend.com/rvm/install/) 中的说明进行操作

I typed the following:

我输入了以下内容:

sudo bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )

the script executed and didn't seem to give any errors.

脚本执行了,似乎没有给出任何错误。

the same without sudo gave an error:

同样没有 sudo 给出了错误:

Warning: Failed to create the file 
Warning: /usr/share/ruby-rvm/archives/wayneeseguin-rvm-stable.tgz: Permission 
Warning: denied
  0  792k    0  3908    0     0   2257      0  0:05:59  0:00:01  0:05:58  2257
curl: (23) Failed writing body (0 != 3908)

Could not download 'https://github.com/wayneeseguin/rvm/tarball/stable'.
  curl returned status '23'.

I also put this in my ~/.bashrc

我也把它放在我的 ~/.bashrc 中

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

what I get is:

我得到的是:

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

~$ source "/usr/local/rvm/scripts/rvm"
bash: /usr/local/rvm/scripts/rvm: No such file or directory

~$ source "$HOME/.rvm/scripts/rvm"
bash: /home/anonym/.rvm/scripts/rvm: No such file or directory

How can this be fixed?

如何解决这个问题?

PS

聚苯乙烯

I'm using Ubuntu 11.10

我正在使用 Ubuntu 11.10

采纳答案by Karthick S

Can you try this:

你能试试这个吗:

$ curl -s raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable

or

或者

$ curl -s raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | sudo bash -s stable

depending on your permissions. That should help. It helped me! :)

取决于您的权限。那应该有帮助。它帮助了我!:)

回答by hec

Sudo problems. This worked for me to install rvm. Just do:

须藤问题。这对我安装 rvm 很有用。做就是了:

curl -L https://get.rvm.io | sudo bash -s stable --ruby

回答by Igor Yuzovitskiy

nano ~/.bashrc

at the bottom of the file add these line

在文件底部添加这些行

unset rvm_path
unset GEM_HOME

Then run

然后运行

curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.3
rvm use 2.1.3 --default
ruby -v

回答by garrettux

I'm sure there's a more elegant way to fix this, but I ran into the same issue and was kinda in a hurry, so I went for a quick and dirty workaround:

我确信有一种更优雅的方法来解决这个问题,但我遇到了同样的问题并且有点匆忙,所以我采取了一个快速而肮脏的解决方法:

$ curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer > foo.sh
$ chmod 755 foo.sh

Then edit line 162, and add -k to the curl command:

然后编辑第 162 行,并将 -k 添加到 curl 命令:

$ vim foo.sh
162 if curl -Lk https://github.com/${_repo}/rvm/tarball/${_branch} -o ${rvm_archives_path}/${_repo}-rvm-${_branch}.tgz

Then run the script:

然后运行脚本:

$ ./foo.sh --branch stable

Like I said, not ideal, but it got me where I needed to be quickly.

就像我说的,并不理想,但它让我到达了我需要快速到达的地方。

回答by dubvfan87

If anyone has this problem in the future in ubuntu I was getting this error because of an old package that still had config stuff hanging around.

如果将来有人在 ubuntu 中遇到这个问题,我会收到这个错误,因为一个旧包仍然有配置内容。

Try running

尝试跑步

sudo apt-get --purge remove ruby-rvm

That should take care of the permission error and let you install RVM as a normal user under $HOME/.rvm

这应该处理权限错误,并让您在 $HOME/.rvm 下以普通用户身份安装 RVM

回答by Sergio Tulentsev

Put this in your .bashrc instead (without echo)

把它放在你的 .bashrc 中(没有echo

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

And restart your terminal.

并重新启动您的终端。

回答by Joshua Plicque

You might have RVM installed under the wrong user. RVM won't let you install if it's installed under another user.

您可能在错误的用户下安装了 RVM。如果 RVM 安装在其他用户下,则不会让您安装。

You can uninstall it from the other user with rvm implode.

您可以使用rvm implode.

Log over to the other user and RVM will install correctly!

登录到其他用户,RVM 将正确安装!

回答by u8252541

https://rvm.io/rvm/security#ipv6-issuesYou can forbid gpg's internal dirmngr from using IPv6 by add the following line to ~/.gnupg/dirmngr.conf:

https://rvm.io/rvm/security#ipv6-issues您可以通过在 ~/.gnupg/dirmngr.conf 中添加以下行来禁止 gpg 的内部 dirmngr 使用 IPv6: