【问题标题】:You don't have write permissions for the /usr/bin directory. while installing Cocoapods您没有 /usr/bin 目录的写入权限。在安装 Cocoapods 时
【发布时间】:2018-10-29 13:43:36
【问题描述】:

我正在尝试在我的 Mac 上使用以下命令安装 Cocoapods:

sudo gem install cocoapods

但我收到以下错误:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/bin directory.

真的没有意义,因为我正在做的是通过 sudo 作为 root 用户。任何帮助将不胜感激!

我正在使用 gem 版本 2.7.7(截至今天的最新版本)。

【问题讨论】:

    标签: rubygems cocoapods


    【解决方案1】:

    试试这个,它对我有用

    sudo gem install cocoapods -n /usr/local/bin
    

    This answer 有关于为什么/usr/bin 受到保护的信息。

    【讨论】:

    • 这是否意味着pod update 信息消息“CocoaPods 1.10.0 可用。要更新使用:sudo gem install cocoapods”不正确?这是造成混乱的根本原因吗?
    猜你喜欢
    • 2018-08-19
    • 2011-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-10
    • 1970-01-01
    • 2015-02-13
    相关资源
    最近更新 更多