如果gem因权限错误而失败,如何安装gem或更新RubyGems

当尝试使用或更新RubyGems时遇到权限错误,问题出在没有对/Library/Ruby/Gems/1.8目录的写权限。建议使用rbenv或RVM管理独立的Ruby版本,以避免系统Ruby的权限问题。如果已经启用root用户,确保在终端以root用户身份登录。另外,正确使用Ruby版本管理器如rbenv,可以防止和解决权限问题,同时检查PATH环境变量确保shims目录在系统Ruby之前。
摘要由CSDN通过智能技术生成

本文翻译自: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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值