$gem sources -l
*** CURRENT SOURCES *** https://rubygems.org/
$gem sources --remove https://rubygems.org/
https://rubygems.org/ removed from sources
$gem sources -a http://rubygems-china.oss.aliyuncs.com
$sudo gem install cocoapods
3 gems installed
$ sudo gem update --system然后检查是否可以ping通github,在终端中输入:
$ ping github.com然后查看pob repo list:
$ pod repo list说明Cocoapods在将它的信息下载到 ~/.cocoapods里; cd 到该目录里,用du -sh *命令来查看文件大小,结果显示0 repos,说明没有安装成功; 在终端输入: cd ~/.cocoapods 进入cocoapods文件后在终端输入:du -sh * [img]http://files.jb51.net/file_images/article/201609/2016093022085630.png[/img] 重新执行pod setup,过一段时间后提示setup completed,在终端中输入 pod list,展示出安装列表; 这样总算安装好了。接下来再一次输入: pod search AFNetworking 输入过后它可能会报: [!] Unable to find a pod with name, author, summary, or descriptionmatching `AFNetworking` 解决方案是: 输入: rm ~/Library/Caches/CocoaPods/search_index.json 后在一次输入:pod search AFNetworking 就可以咯。
platform :ios, '8.1' pod 'AFNetworking', '~> 2.0' 它会报:[!] The dependency `AFNetworking (~> 3.0)` is not used in any concrete target. 现在版本升级官方给的文档是:platform :ios, '8.0' target '你的项目名称' do pod 'AFNetworking', '~> 3.0' end 注意:'你的项目名称'是你项目文件中'xx.xcodeproj'文件,'xx.xcodeproj'去掉后缀名所得的‘xx'==(就是)‘你的项目名称' 输入完成后按ESC退出编辑模式,最后输入:wq保存并退出文件。此时可以发现在项目目录下多了一个Podfile的文件,请注意这个文件必须与.xcodeproj在同一目录下。 最后: pod install 没报错就可以了。
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有