如何删除权限被拒绝@ rb_sysopen-宝石安装错误? [英] How do I remove Permission denied @ rb_sysopen - Gem install error?
问题描述
我正在尝试在Ruby on Rails上安装创建一个新应用,但是我无法通过此错误:
I am trying to install create a new app in Ruby on Rails and I cannot get passed this error:
$ gem install pg
错误:执行gem时...(Errno :: EACCES) 权限被拒绝@ rb_sysopen-/Users/stormyramsey/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/pg-0.21.0/.gemtest
ERROR: While executing gem ... (Errno::EACCES) Permission denied @ rb_sysopen - /Users/stormyramsey/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/pg-0.21.0/.gemtest
推荐答案
它是权限问题.您可以通过以下方式解决它:
Its a permissions issue. You could fix it with this:
sudo chown -R $(whoami) /Library/Ruby/Gems/*
或者可能是您的情况
sudo chown -R $(whoami) /Users/stormyramsey/.rbenv/versions/2.3.2/lib/ruby/gems/*
这是做什么的:
这是告诉系统更改文件以将所有权更改为当前用户.安装某些东西时一定弄得一团糟.通常这是因为有多个帐户,或者用户在不必总是必须使用sudo进行安装时.
This is telling the system to change the files to change the ownership to the current user. Something must have gotten messed up when something got installed. Usually this is because there are multiple accounts or users are using sudo to install when they should not always have to.
这篇关于如何删除权限被拒绝@ rb_sysopen-宝石安装错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!