pod update
//错误
Updating local specs repositories
[!] The `master` repo requires CocoaPods 1.0.0 - (currently using 0.39.0)
Update CocoaPods, or checkout the appropriate tag in the repo.
于是更新cocopods
sudo gem install cocoapods
//依旧失败
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/xcodeproj
猜测是gem版本太低,于是继续
sudo gem update --system
//还是失败
Updating rubygems-update
Fetching: rubygems-update-2.6.8.gem (100%)
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/update_rubygems
查看了一下gem的版本
gem -v
2.6.1
从网上寻找解决办法
sudo gem install -n /usr/local/bin cocoapods
//显示如下
Successfully installed xcodeproj-1.4.1
Fetching: molinillo-0.5.4.gem (100%)
Successfully installed molinillo-0.5.4
Fetching: gh_inspector-1.0.2.gem (100%)
....省略好多行
再次执行
pod update
//失败
Performing a deep fetch of the `master` specs repo to improve future performance
[!] /usr/bin/git -C /Users/jing/.cocoapods/repos/master fetch --unshallow
error: RPC failed; curl 56 SSLRead() return error -9806
fatal: The remote end hung up unexpectedly
然后执行
pod repo update --verbose
//显示如下
$ /usr/bin/git -C /Users/jing/.cocoapods/repos/master pull --ff-only
From https://github.com/CocoaPods/Specs
544d169..d362e91 master -> origin/master
Updating c479d4f..d362e91
......
CocoaPods 1.2.0.beta.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.0.beta.1
然后
pod update
//错误如下
[!] The dependency `xxxx` is not used in any concrete target.
The dependency `xxxx` is not used in any concrete target.The The dependency `xxxx` is not used in any concrete target.
The dependency `xxxx` is not used in any concrete target.
解决方法如下://加上target:
将Podfile中的代码改成如下形式即可。
platform :ios, '8.0'
use_frameworks!
target 'MyApp' do
pod 'AFNetworking', '~> 2.6'
pod 'ORStackView', '~> 3.0'
pod 'SwiftyJSON', '~> 2.3'
end
备注:另外,可以通过pod init命令在工程文件夹下生成一个默认的Podfile文件。
更改完成后
pod repo update --verbose
pod update
//显示如下(成功)
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (3.1.0)
Installing ........
Sending stats
Pod installation complete! There are 14 dependencies from the Podfile and 15 total pods installed.
成功。。。。