ios - 更新了cocoapods出现了这样的问题

 lc蓝晨 发布于 2022-11-07 08:30

$ sudo pod install

/Users/YSQ/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/claide-0.5.0/lib/claide/command.rb:328:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)

CocoaPods, the Objective-C library package manager.

Commands:

* help       Show help for the given command.
* init       Generate a Podfile for the current directory.
- install    Install project dependencies
* ipc        Inter-process communication
* lib        Develop pods
* list       List pods
* outdated   Show outdated project dependencies
* push       Push new specifications to a spec-repo
* repo       Manage spec-repositories
* search     Searches for pods
* setup      Setup the CocoaPods environment
* spec       Manage pod specs
* update     Update outdated project dependencies

Options:

--silent    Show nothing
--version   Show the version of CocoaPods
--no-ansi   Show output without ANSI codes
--verbose   Show more debugging information
--help      Show help banner of specified command
from /Users/YSQ/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.32.1/lib/cocoapods/command.rb:46:in `run'
from /Users/YSQ/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.32.1/bin/pod:33:in `'
from /Users/YSQ/.rvm/rubies/ruby-2.0.0-p247/bin/pod:23:in `load'
from /Users/YSQ/.rvm/rubies/ruby-2.0.0-p247/bin/pod:23:in `
'
10 个回答
  •  接着执行运行:$ sudo gem install cocoa pods

             $ pod install
             

    就好了

    2022-11-12 01:42 回答
  • http://blog.csdn.net/hengshujiyi/article/details/40303457

    参照这个帖子,我居然奇迹般的好了。怪哉~

    2022-11-12 01:42 回答
  • $ sudo gem uninstall cocoapods
    $ sudo gem uninstall xcodeproj
    $ sudo gem install xcodeproj
    $ sudo gem install cocoapods
    2022-11-12 01:42 回答
  • CocoaPods 在 0.32.0 去掉了 root 权限运行命令。这个问题可能是缓存中有一些需要 root 权限运行的文件,所以试试删除缓存的方法。

    先删除全局的缓存:

    $ sudo rm -fr ~/Library/Caches/CocoaPods/
    $ sudo rm -fr ~/.cocoapods/repos/master/
    

    还不行的话就把当前 Pods 目录清空:

    $ sudo rm -fr Pods/
    

    之后再运行:

    $ pod install
    

    CocoaPods 的 Troubleshooting 有一段解释:I'm getting permission errors while running pod commands。

    2022-11-12 01:42 回答
  • 以上答案皆不管用。

    2022-11-12 01:42 回答
  • sudo rm -fr ~/.cocoapods/repos/master
    pod setup
    pod repo remove master
    pod setup
    

    用上面的代码,原因是cocoapods升级后出现冲突。
    如果速度慢的话,且你有gae,给本次的终端设置代理

    export http_proxy='http://127.0.0.1:8087'
    export https_proxy='http://127.0.0.1:8087'
    

    如果你遇到git证书问题,可以导入gae的证书

    git config --global http.sslCAinfo ~/goagent/local/CA.crt 
    

    以上

    2022-11-12 01:42 回答
  • 先运行 sudo rm -fr ~/.cocoapods/repos/master
    然后 pod setup
    试试...

    2022-11-12 01:42 回答
  • 楼主,我也遇到同样的问题,昨天更新的cocoapods0.32.1后出
    现/Library/Ruby/Gems/2.0.0/gems/claide-0.5.0/lib/claide/command.rb:328:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)

    CocoaPods, the Objective-C library package manager.

    Commands:

    * help       Show help for the given command.
    * init       Generate a Podfile for the current directory.
    - install    Install project dependencies
    * ipc        Inter-process communication
    * lib        Develop pods
    * list       List pods
    * outdated   Show outdated project dependencies
    * push       Push new specifications to a spec-repo
    * repo       Manage spec-repositories
    * search     Searches for pods
    * setup      Setup the CocoaPods environment
    * spec       Manage pod specs
    * update     Update outdated project dependencies
    

    Options:

    --silent    Show nothing
    --version   Show the version of CocoaPods
    --no-ansi   Show output without ANSI codes
    --verbose   Show more debugging information
    --help      Show help banner of specified command
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.32.1/lib/cocoapods/command.rb:46:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.32.1/bin/pod:33:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'
    
    2022-11-12 01:42 回答
  • sudo pod install

    You cannot run CocoaPods as root

    2022-11-12 01:42 回答
  • 直接 $ [sudo] gem install cocoapods 就好了,sudo 可选.

    2022-11-12 01:42 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有