xcode 'sudo gem install cocoapods' 在 El Capitan 10.11.4 上不起作用,错误:在任何存储库中找不到有效的 gem 'cocoapods' (>= 0)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36972339/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:46:46  来源:igfitidea点击:

'sudo gem install cocoapods' doesn't work on El Capitan 10.11.4 , ERROR: Could not find a valid gem 'cocoapods' (>= 0) in any repository

xcodecocoapodsosx-elcapitan

提问by Naishta

Upgrading from Yosemite to El Capitan seem to have wiped out the already installed CocoaPods. When I pod install Alamofire/SwiftyJson, it says 'Pod command not found', and as per the stackoverflow solutions I uninstalled cocoapods and trying to reinstall it with the commands

从 Yosemite 升级到 El Capitan 似乎已经消灭了已经安装的 CocoaPods。当我 pod install Alamofire/SwiftyJson 时,它说'Pod command not found',并且根据 stackoverflow 解决方案,我卸载了 cocoapods 并尝试使用命令重新安装它

 - sudo gem uninstall cocoapods
 - sudo gem install cocoapods

I get the error:

我收到错误:

"Could not find a valid gem 'cocoapods' (>= 0) in any repository"

“在任何存储库中都找不到有效的 gem 'cocoapods' (>= 0)”

Did go through ALL the solutions mentioned by the Gurus under the issue https://github.com/CocoaPods/CocoaPods/issues/3736

确实在问题https://github.com/CocoaPods/CocoaPods/issues/3736下完成了 Gurus 提到的所有解决方案

mainly tried this which seem to have worked for many. still doesn't work for me.

主要尝试过这个似乎对很多人都有效。仍然对我不起作用。

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

tried modifying the permissions etc as per the solutions provided in the above link and the SO link

尝试根据上述链接和 SO 链接中提供的解决方案修改权限等

http://stackoverflow.com/questions/30812777/cannot-install-cocoa-pods-after-uninstalling-results-in-error?rq=1

Nothing works, EVERYTHING leads to the same error "Could not find a valid gem 'cocoapods' (>= 0) in any repository"

什么都不起作用,一切都会导致相同的错误“在任何存储库中都找不到有效的 gem 'cocoapods' (>= 0)”

I have also raised a issue on

我也提出了一个问题

https://github.com/CocoaPods/CocoaPods/issues/5232

回答by Alaa Aljohani

I faced the same problem and it was fixed by using the following command

我遇到了同样的问题,它是通过使用以下命令修复的

$ sudo gem install cocoapods --source http://rubygems.org

回答by Tarun Seera

I struggled with same issue 1 week, finally this works for me

我在同一个问题上挣扎了 1 周,最后这对我有用

Disable IPv6 and try againwith sudo gem install cocoapods --source http://rubygems.org

禁用 IPv6 并使用sudo gem install cocoapods --source http://rubygems.org重试

Issues seems with network

网络似乎有问题

Few more details give on rugby gems forum - https://help.rubygems.org/discussions/problems/31074-timeout-error

关于橄榄球宝石论坛的更多细节 - https://help.rubygems.org/discussions/problems/31074-timeout-error