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.
成功。。。。