2011-12-23 407 views
16

我跟着从RVM主页(https://rvm.beginrescueend.com/rvm/install/)的说明RVM安装失败

我键入以下内容:

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

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

没有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'. 

我也把这个在我的〜/ .bashrc

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

什么,我得到的是:

~$ 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 

哪有这是固定的?

PS

我使用Ubuntu 11.10

+0

您是否尝试在更改.bashrc后重新加载会话?要做到这一点,请使用'source〜/ .bashrc'或打开新的终端窗口。 – 2011-12-23 03:53:27

+0

当然,我都尝试过。 – gisek 2011-12-23 04:13:14

+0

您是否试图为您自己的个人开发安装RVM,或者为共享主机上的所有用户安装RVM?除非你是一个系统管理员为每个人做它,否则你应该使用单用户安装,每个RVM的安装页面。 – 2011-12-24 19:28:27

回答

11

你可以试试这个:这取决于您的权限

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

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

。这应该有所帮助。它帮助了我! :)

+0

工作中,如果你使用sudo或者你创建一个有权先写入的目录。 – gisek 2011-12-26 23:37:56

+0

确保您已将您的用户添加到rvm组。此外,请确保您注销并登录。组成员身份在登录时处理,因此为了写入/ usr/local/rvm,您必须注销并登录,以便操作系统识别出您处于rvm组。 – GregB 2014-01-12 20:08:14

1

在你的.bashrc,而不是将这个(不echo

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

,并重新启动终端。

+0

它没有帮助。总之没有这样的目录。 – gisek 2011-12-23 10:18:46

+0

然后你的第一步出错了。你有没有从它的日志?或者你可以重试? – 2011-12-23 12:58:32

6

我敢肯定有一个更优雅的方式来解决这个问题,但我碰到了同样的问题,是有点着急,所以我去了一个快速和肮脏的解决方法:

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

然后编辑行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 

然后运行该脚本:

$ ./foo.sh --branch stable 

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

+0

不断挖掘一点,发现这一点:http://stackoverflow.com/questions/6414232/curl-certificate-error-when-using-rvm-to-install-ruby-1-9-2。特别是@dbikard提供的更新cacert bundle for curl的说明。 – garrettux 2012-01-09 16:18:36

+0

在AWS Centos 5映像上,其他解决方案都不适用于我。 – chaostheory 2012-01-15 10:37:11

+0

这个解决方案“的作品”对我来说,因为部分我不得不去我foo.sh文件中,并用 https://nodeload.github.com/ – Leo 2012-05-24 00:40:54

2

如果任何人在将来的ubuntu有这个问题,我得到这个错误,因为旧的软件包,仍然有配置东西四处闲逛。

尝试运行

sudo apt-get --purge remove ruby-rvm 

这应该照顾权限错误的,让你安装RVM作为下$ HOME /普通用户。RVM

15
nano ~/.bashrc 

在文件的底部添加这些行

unset rvm_path 
unset GEM_HOME 

然后运行

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 
+1

我不得不更换 https://github.com/ 到'source〜/ .bashrc',然后curl会为我工作,但它确实! – Karen 2016-02-06 20:57:36

1

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

您可以使用rvm implode从其他用户中卸载它。

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

27

Sudo问题。这对我来说安装rvm。只要这样做:

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

这在Fedora 20上适用于我,谢谢! – 2015-11-02 19:39:38

+0

它在Ubuntu 14.04上工作。谢谢:) – meboban 2015-12-03 11:29:06

+0

对Ubuntu有用14.04 – potapuff 2016-09-29 07:24:26