ios - 更新了cocoapods出现了这样的问题
天蓬老师
天蓬老师 2017-04-17 12:08:04
[iOS讨论组]

$ 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 `<top (required)>'
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 `<main>'
天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

全部回复(10)
黄舟

直接 $ [sudo] gem install cocoapods 就好了,sudo 可选.

ringa_lee

sudo pod install

You cannot run CocoaPods as root

伊谢尔伦

楼主,我也遇到同样的问题,昨天更新的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>'
怪我咯

先运行 sudo rm -fr ~/.cocoapods/repos/master
然后 pod setup
试试...

PHP中文网
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 

以上

怪我咯

以上答案皆不管用。

巴扎黑

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。

迷茫
$ sudo gem uninstall cocoapods
$ sudo gem uninstall xcodeproj
$ sudo gem install xcodeproj
$ sudo gem install cocoapods
天蓬老师

http://blog.csdn.net/hengshujiyi/article/details/40303457

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

伊谢尔伦

 接着执行运行:$ sudo gem install cocoa pods

         $ pod install
         

就好了

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号