本文翻译自:How to install a gem or update RubyGems if it fails with a permissions error
I'm trying to install a gem using gem install mygem
or update RubyGems using gem update --system
, and it fails with this error: 我正在尝试使用gem install mygem
或使用gem update --system
更新RubyGems,但失败并显示以下错误:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
Does anyone have an idea how to solve this? 有谁知道如何解决这个问题?
#1楼
参考:https://stackoom.com/question/zHzt/如果gem因权限错误而失败-如何安装gem或更新RubyGems
#2楼
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory. 您没有对/Library/Ruby/Gems/1.8目录的写许可权。
means exactly that, you don't have permission to write there. 就是说,您没有在那儿写的权限。
That is the version of Ruby installed by Apple, for their own use. 这是Apple安装的供自己使用的Ruby版本。 While it's OK to make minor modifications to that if you know what you're doing , because you are not sure