ruby 安装 RVM:收到错误“发生错误 (23)”。
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26242712/
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
Installing RVM: getting error "There was an error(23)."
提问by Kimda K
I am trying to install Ruby Version Manager (RVM) without success. How to get through this error I am getting?
我正在尝试安装 Ruby 版本管理器 (RVM),但没有成功。如何解决我遇到的这个错误?
ubuntu@ip-172-31-0-20:/tmp$ rvm install ruby-1.9.3-p484
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/14.04/x86_64/ruby-1.9.3-p484.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p484, this may take a while depending on your cpu(s)...
ruby-1.9.3-p484 - #downloading ruby-1.9.3-p484, this may take a while depending on your connection...
Warning: Failed to create the file ruby-1.9.3-p484.tar.bz2.part: Permission
Warning: denied
0 9806k 0 1002 0 0 22905 0 0:07:18 --:--:-- 0:07:18 23302
curl: (23) Failed writing body (0 != 1002)
There was an error(23).
Checking fallback: http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.bz2
Warning: Failed to create the file ruby-1.9.3-p484.tar.bz2.part: Permission
Warning: denied
0 9806k 0 1167 0 0 4300 0 0:38:55 --:--:-- 0:38:55 4290
curl: (23) Failed writing body (0 != 1167)
There was an error(23).
Failed download
There has been an error fetching the ruby interpreter. Halting the installation.
ubuntu@ip-172-31-0-20:/tmp$
回答by mpapis
Your RVM is installed in /usr/local/rvm- it's often called system installation, this requires that your user ubuntuwill be added to rvmgroup:
您的 RVM 安装在/usr/local/rvm- 通常称为系统安装,这需要将您的用户ubuntu添加到rvm组:
rvm group add rvm "$USER"
yes use $USERit will be replaced by your shell with your user name
是的,使用$USER它会被你的 shell 替换为你的用户名
then log out and log in, ensure with:
然后注销并登录,确保:
id
that your user is in rvmgroup,
您的用户在rvm组中,
finally just in case update permissions for RVM:
最后以防万一更新 RVM 的权限:
rvm fix-permissions
回答by Swaps
The solution by @mpasis might not work if you're installing rvmusing ubuntu_rvmas by default because of copy+pasteit'll be installed as root.
Try installing rvmwith without sudoor with curlas explained on rvm.io.
如果您默认rvm使用ubuntu_rvm 进行安装,@mpasis 的解决方案可能不起作用,因为copy+paste它将安装为root. 尝试按照rvm.io 上的说明rvm使用 withoutsudo或 with安装。curl

