问题1:
Could not find a valid gem 'cocoapods' (>= 0) in any repository
解决方案:
终端中执行如下命令:
$ gem sources -l
$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -l
以上就改变了ruby的镜像源,然后再执行:
sudo gem install cocoa pods
直到看到
gems installed的字样
问题2:pod install出错
解决方法:
在Podfile文件里指定下工程目录就行了,比如我在Podfile文件添加这行就行了:
问题3: update或install时遇到这个问题
[!] Unable to find the Xcode project `/Users/dongwei/Portfolio/Portfolio.xcodeproj` for the target `Pods`.
解决办法:
只需要把当前Pod的目录清理一下就行了。在终端执行以下命令:
setup成功后执行install或update即可。
问题4:Pod install 被墙了
解决办法:
pod install <wbr><span style="word-wrap: normal; word-break: normal; line-height: 24px;">被墙了,请大家</span><span style="word-wrap: normal; word-break: normal; line-height: 24px;">换成pod install --verbose --no-repo-update</span> </wbr>