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

发布于 2022-08-28 13:00:47 字数 1488 浏览 24 评论 0

$ 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>'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

一个人的夜不怕黑 2022-09-04 13:00:47

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

焚却相思 2022-09-04 13:00:47

sudo pod install

You cannot run CocoaPods as root

空宴 2022-09-04 13:00:47

楼主,我也遇到同样的问题,昨天更新的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-09-04 13:00:47

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

偷得浮生 2022-09-04 13:00:47
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-09-04 13:00:47

以上答案皆不管用。

茶底世界 2022-09-04 13:00:47

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-09-04 13:00:47
$ sudo gem uninstall cocoapods
$ sudo gem uninstall xcodeproj
$ sudo gem install xcodeproj
$ sudo gem install cocoapods
下壹個目標 2022-09-04 13:00:47

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

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

倾`听者〃 2022-09-04 13:00:47

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

         $ pod install
         

就好了

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文