osx升级到10.10后,用pod install报错终于解决的方法
先依照这个文章做:http://blog.csdn.net/dqjyong/article/details/37958067
大概过程例如以下:
- Open Xcode 6
- Open Preferences
- Click the
Locations
tab - Change the
Command Line Tools
version toXcode 6.0
- Uninstall
cocoapods
a.$ sudo gem uninstall cocoapods
- Install
xcodeproj
a.$ sudo gem install xcodeproj
- Install
cocoapods
a.$ sudo gem install cocoapods
- Run
pod --version
to verify that it worked
假设你运行到第6步:sudo gem install xcodeproj 成功,可是到第七步:$ sudo gem install cocoapods
时失败,错误信息例如以下:
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (https://rubygems.org/latest_specs.4.8.gz)
ERROR: Possible alternatives: cocoapods
意识是说在官方源中找不到我们须要的源,这时怎么办呢,网上找到一篇博客,这样做的。切换官方源。也即是改变源的获取地址
这时候我们须要改变 gem source, 參考[4], [5]。
须要在终端中运行例如以下命令:
$ gem sources -l
$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -l
接下来输入下面命令:
$ pod setup
This process will likely take a while as this command clones the CocoaPods Specs repository
into ~/.cocoapods/ on your computer. [6]
至此CocoaPods安装完成。
注: 假设漏掉 "$ pod setup" 命令,而直接运行"$ pod init"
会有类似下面的error信息:
"$ pod init
Setting up CocoaPods master repo
[!] /usr/bin/git clone 'https://github.com/CocoaPods/Specs.git' master --depth=1
Cloning into 'master'...
error: RPC failed; result=52, HTTP code = 0
fatal: The remote end hung up unexpectedly
/Library/Ruby/Gems/2.0.0/gems/claide-0.6.1/lib/claide/command.rb:304:in `handle_exception': undefined method `verbose?' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/claide-0.6.1/lib/claide/command.rb:284:in `rescue in run'
from /Library/Ruby/Gems/2.0.0/gems/claide-0.6.1/lib/claide/command.rb:274:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command.rb:48:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/bin/pod:33:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>' "
以上操作步骤完毕后在进行:$ sudo gem install cocoapods
这时就成功了!
剩下的就是和曾经的一样在project文件夹下,建Podfile,运行pod install,打开xworkspace等,顺利完毕!
!。
參考博客:http://www.cnblogs.com/cwgk/p/3370949.html
最新文章
- iOS10 UI教程基础窗口的内容与设置起始窗口
- [异常] JLink Error: Could not find supported CPU core on JTAG chain J-Link连接不到stm32内核问题
- 【python】python环境的安装与配置
- 装载:对CSS中的Position、Float属性的一些深入探讨
- bluebird-Core API(一)
- jshint 安装使用
- [微软实习生2014]K-th string
- Jquery实现日期格式化
- A Simple Task
- NPY and girls
- Android开发艺术探究Note
- 10_ for 练习 _ is Prime Number ?
- (深度好文)重构CMDB,避免运维之耻
- JavaMail入门第一篇 邮件简介及API概述
- Elasticsearch学习笔记——分词
- Matconvnet 的一些记录
- noip2017奶酪
- CSS 的 ID 和 Class 有什么区别,如何正确使用它们。
- java 递归 树形
- POJ 1860&;&;3259&;&;1062&;&;2253&;&;1125&;&;2240
热门文章
- [BZOJ 4033] 树上染色
- UVA 10160 Servicing Stations(状态压缩+迭代加深)
- 【并查集】【set】AtCoder - 2159 - 連結 / Connectivity
- IOS之Block的应用-textFeild的回调应用
- <;摘录>;字节对齐(强制对齐以及自然对齐)
- 水晶报表导出完美EXCEL表格
- Android Facebook和Twitter登录和分享完整版
- cocos2dx -lua 面向对象-转
- nginx+lua+redis
- OneThink框架的文章详情页分页