4

我正在尝试通过 RVM 安装 ruby​​ 并收到以下错误,并且日志并不清楚发生了什么,有人遇到过这个吗?我似乎记得 Ruby 不应该以 root 身份安装,但我对我得到的权限错误有点怀疑。

**Installing Ruby from source to: /Users/mark/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...
ruby-1.9.2-p290 - #fetching 
ruby-1.9.2-p290 - #downloading ruby-1.9.2-p290, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Failed to create the file ruby-1.9.2-p290.tar.bz2: Permission denied
  0 8604k    0 16150    0     0  14980      0  0:09:48  0:00:01  0:09:47 26562
curl: (23) Failed writing body (0 != 16150)
ERROR: There was an error, please check /Users/mark/.rvm/log/ruby-1.9.2-p290/*.log. Next we'll try to fetch via http.
Trying http:// URL instead.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Failed to create the file ruby-1.9.2-p290.tar.bz2: Permission denied
  0 8604k    0 16150    0     0  24640      0  0:05:57 --:--:--  0:05:57 28333
curl: (23) Failed writing body (0 != 16150)
ERROR: There has been an error while trying to fetch the source.  
Halting the installation.
ERROR: There has been an error fetching the ruby interpreter. Halting the installation.**
4

5 回答 5

17

我有同样的错误消息,我通过执行sudo chown -R user:user /usr/local/rvmwhere useris your login user 解决了它,之后我运行 rvm install 1.9.2 并成功完成。

于 2011-10-10T17:19:24.327 回答
2

我喜欢上面的解决方案,但不是使用 user:user do user:rvm。

于 2013-03-16T23:31:35.400 回答
2

确保您已将用户添加到 rvm 组。另外,请确保您注销并登录。组成员身份在登录时处理,因此为了写入 /usr/local/rvm,您必须先注销然后登录,以便操作系统识别您在rvm 组。

于 2014-01-12T20:06:46.193 回答
1

错误似乎是

Failed to create the file ruby-1.9.2-p290.tar.bz2: Permission denied

您是否曾经尝试过使用 sudo 做某事?你要确保/Users/mark/.rvm/rubies/它对你的用户是可写的。

于 2011-10-03T18:18:46.283 回答
0

对于现在进来的开发者,如果你使用的是多模式 rvm 安装,记得像这样将当前用户添加到 rvm 组

rvm group add rvm $USER

于 2021-08-12T22:36:07.060 回答