我正在尝试通过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.**
答案 0 :(得分:17)
我有相同的错误消息,我通过执行sudo chown -R user:user /usr/local/rvm
来解决它,其中user
是您的登录用户,之后我运行了rvm install 1.9.2并且它已成功完成。
答案 1 :(得分:2)
我喜欢上面的解决方案,但不是使用user:user do user:rvm。
答案 2 :(得分:2)
确保已将用户添加到rvm组。此外,请确保您注销并登录。组成员身份在登录时处理,因此为了写入/ usr / local / rvm,您必须注销然后登录才能让操作系统识别出您在rvm group。
答案 3 :(得分:1)
错误似乎是
Failed to create the file ruby-1.9.2-p290.tar.bz2: Permission denied
你有没有尝试过sudo一次?您希望确保/Users/mark/.rvm/rubies/
可供您的用户使用。