xcode 无法安装 pod(致命:无法访问“https://github.com/CocoaPods/Specs.git/”)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21158831/
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 04:33:17  来源:igfitidea点击:

Cannot install a pod (fatal: unable to access 'https://github.com/CocoaPods/Specs.git/')

iosiphonexcodegitcocoapods

提问by kagmanoj

I'm trying to use the command pod install and always have that :

我正在尝试使用命令 pod install 并且始终具有:

$ pod setup

OR

$ sudo pod setup

Setting up CocoaPods master repo
[!] Pod::Executable clone 'https://github.com/CocoaPods/Specs.git' master

Cloning into 'master'...
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': Failed connect to     github.com:443; Operation timed out

/Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:217:in `rescue in run': undefined method `verbose?' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:210:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:51:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/bin/pod:24:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>'

I have no idea what this is about. Can someone help me? This is the first time I try to do anything with CocoaPods on OS X Mavericks.

我不知道这是关于什么的。有人能帮我吗?这是我第一次尝试在 OS X Mavericks 上使用 CocoaPods 做任何事情。

Thanks!

谢谢!

回答by Chandle.WEi

First please check your network, you can use curlor git cloneto check it directly under terminal

首先请检查您的网络,您可以使用curlgit clone直接在终端下检查

If you have another problem you can try gem uninstall claideand then install it

如果您有其他问题,您可以尝试gem uninstall claide然后安装它

Or you can try ruby 1.9

或者你可以试试 ruby​​ 1.9

cocoapods 0.29 and claide 0.4.0 works fine under my ruby 1.9 env

cocoapods 0.29 和 claide 0.4.0 在我的 ruby​​ 1.9 环境下工作正常

you can use rvmto work with different ruby env

您可以使用rvm不同的 ruby​​ 环境

回答by Alex Balas

I got the same issue while using a virtual machine. I started getting the error after switching connection to Bridged. The problem was that the machine had no MAC address generated.

我在使用虚拟机时遇到了同样的问题。将连接切换到桥接后,我开始收到错误消息。问题是机器没有生成 MAC 地址。

Solution: Go to Network Adapter settings -> Advanced -> press Generate MAC Address

解决方案:进入网络适​​配器设置 -> 高级 -> 按生成 MAC 地址