安裝CocoaPods
打開terminal
gem install cocoapods -V
加上-V 可以顯示指令正在動作
因為要有點久所以最好可以看到安裝的過程
選擇single-view
創造一個專案
然後建立在桌面上
然後回到終端機
ls
cd Desktop/
//創造Podfile檔案
touch Podfile
ls
open Podfile
//進入https://cocoapods.org/?q=AFN
//複製
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
pod 'AFNetworking', '~> 3.0'
pod install -V
然後會出現
Setting up CocoaPods master repo
如果安裝失敗
輸入
pod repo remove master
pod setup
“`
Setting up CocoaPods master repo
Cloning spec repo master
from https://github.com/CocoaPods/Specs.git
(branch master
)
$ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master
Cloning into ‘master’…
Checking out files: 100% (88167/88167), done.
$ /usr/bin/git checkout master
Already on ‘master’
Your branch is up-to-date with ‘origin/master’.
Setup completed
Analyzing dependencies
Inspecting targets to integrate
[!] Unable to find a target named MyApp
, did find CocoaPods
.
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer/target_inspector.rb:110:in compute_targets'
compute_results’
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer/target_inspector.rb:37:in
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer.rb:699:in block (3 levels) in inspect_targets_to_integrate'
each’
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer.rb:696:in
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer.rb:696:in block (2 levels) in inspect_targets_to_integrate'
each’
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer.rb:694:in
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer.rb:694:in block in inspect_targets_to_integrate'
section’
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/user_interface.rb:63:in
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer.rb:689:in inspect_targets_to_integrate'
analyze’
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer.rb:66:in
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer.rb:227:in analyze'
block in resolve_dependencies’
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer.rb:151:in
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/user_interface.rb:63:in section'
resolve_dependencies’
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer.rb:150:in
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer.rb:114:in install!'
run’
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/command/install.rb:37:in
/Library/Ruby/Gems/2.0.0/gems/claide-1.0.0/lib/claide/command.rb:334:in run'
run’
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/command.rb:50:in
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/bin/pod:55:in <top (required)>'
load’
/usr/local/bin/pod:23:in
/usr/local/bin/pod:23:in `’
[!] 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.
FinancialbraindeMacBook-Air:CocoaPods financialbrain$
問題解決
关于pod install 和 pod update
http://www.jianshu.com/p/689368568cf7
cocapods 更新第三方库遇到的问题
http://www.jianshu.com/p/66e8628fce72
深入浅出:SQLite(FMDB)
http://www.jianshu.com/p/13d8faeeae34
iOS开发之CocoaPods的安装与使用
http://blog.csdn.net/pass7580/article/details/49908425
Comments
Post a Comment