podfile
# 指定 私有repo
source '[email protected]:iOSFrameWork/Specs.git'
# 指定 CocoaPods repo
source 'https://github.com/CocoaPods/Specs.git'
platform:ios,7.0
target:CocoaPodsDemo do
pod 'Masonry','1.0.1'
# 本地文件,位于Src目录下,需建立podspec文件
pod 'UPApplePay', :path => 'Src/UPApplePay/1.4.0'
# 私有Repo,该Repo中含有StatisticsKit的podspec文件
pod 'StatisticsKit/Full', '1.0.2'
# 私有库
pod 'SDK', :git => 'http://gitlab-dev.com/iOSFrameWork/SDK.git', :branch => 'developer'
end
Warning&Error
MacBook-Pro:~ $ sudo gem install cocoapods
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: cocoapods requires cocoapods-core (= 1.2.0), cocoapods-downloader (< 2.0, >= 1.1.3), cocoapods-trunk (< 2.0, >= 1.1.2), molinillo (~> 0.5.5), xcodeproj (< 2.0, >= 1.4.1), ruby-macho (~> 0.2.5)
解决方案:升级 gemgem update --system
MacBook-Pro:~ $ gem update --system
Updating rubygems-update
Fetching: rubygems-update-2.6.7.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
解决方案:sudo gem update --system
MacBook-Pro:~ $ sudo gem install cocoapods
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/xcodeproj
解决方案:sudo gem install -n /usr/local/bin cocoapods
MacBook-Pro:CocoaPodsDemo $ pod install
Analyzing dependencies
[!] The dependency `JSONKit (~> 1.4)` is not used in any concrete target.
[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
解决方案:指定target。不要使用文本编辑器去编辑Podfile,应该使用VIM。
platform:ios,7.0
target:CocoaPodsDemo do
pod 'Masonry','1.0.1'
end