Terminator 終端
原來 安裝 cocoa pods 終端命令 :sudo gem install cocoapods #已經無效
系統更新後的 cocoa pods 終端命令 : sudo gem install -n /usr/local/bin cocoapods #如今用這個
你們同在天朝作開發,在 termintor 中輸入cocoapods的安裝命令沒有反應,這就對了說明你也被牆了。
那麼好 咱們 作這一步操做來解決這個問題:
更換Ruby鏡像--淘寶的那個鏡像(https://ruby.taobao.org/ )已經不可用了。官方的須要FQ。因此咱們如今用最新支持的ruby鏡像(https://gems.ruby-china.org/)
須要的命令行:
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.org/
gem sources -l (用來檢查使用替換鏡像位置成功)
出現則說明成功了。
1.驗證你的Ruby 鏡像源 命令:$ gem sources -l
*** CURRENT SOURCES ***
https://gems.ruby-china.org
2.若是是 china.org 的鏡像源,你就能夠直接用 命令 : sudo gem install -n /usr/local/bin cocoapods 安裝。
3.若是不是淘寶的鏡像源:以下操做
$ gem sources --remove https://rubygems.org/
//等有反應以後再敲入如下命令
$ gem source -a https://gems.ruby-china.org
以後在檢查一下鏡像源是否安裝成功。
4. install cocoa pods 完出現以下信息
localhost:~ keku$ sudo gem install -n /usr/local/bin cocoapods
Successfully installed cocoapods-1.0.1
Parsing documentation for cocoapods-1.0.1
1 gem installed
localhost:~ keku$
說明安裝完成
以後輸入命令 :pod setup
出現以下信息 成功。
localhost:~ keku$ pod setup
Setting up CocoaPods master repo
$ /usr/bin/git pull --ff-only
From https://github.com/CocoaPods/Specs
0cacc4d..47c07ed master -> origin/master
Updating 0cacc4d..47c07ed
Fast-forward
.../1.0.0/AppForSaleFramework.podspec.json | 3 +-
.../1.0.10/AppForSaleFramework.podspec.json | 3 +-
.../1.0.11/AppForSaleFramework.podspec.json | 3 +-
.../1.0.13/AppForSaleFramework.podspec.json | 3 +-
.../1.0.16/AppForSaleFramework.podspec.json | 3 +-
.../1.0.17/AppForSaleFramework.podspec.json | 3 +-
.../1.0.18/AppForSaleFramework.podspec.json | 3 +-
.../1.0.19/AppForSaleFramework.podspec.json | 3 +-
.../1.0.20/AppForSaleFramework.podspec.json | 3 +-
.../1.0.21/AppForSaleFramework.podspec.json | 3 +-
.../1.0.22/AppForSaleFramework.podspec.json | 3 +-
.../1.0.23/AppForSaleFramework.podspec.json | 3 +-
.../1.0.25/AppForSaleFramework.podspec.json | 3 +-
.../1.0.26/AppForSaleFramework.podspec.json | 3 +-
.../1.0.27/AppForSaleFramework.podspec.json | 3 +-
.../1.0.28/AppForSaleFramework.podspec.json | 3 +-
.../1.0.29/AppForSaleFramework.podspec.json | 3 +-
.../1.0.30/AppForSaleFramework.podspec.json | 3 +-
.../1.0.31/AppForSaleFramework.podspec.json | 3 +-
.../1.0.37/AppForSaleFramework.podspec.json | 3 +-
.../1.0.38/AppForSaleFramework.podspec.json | 3 +-
.../1.0.39/AppForSaleFramework.podspec.json | 3 +-
.../4.0.0/AppForSaleFramework.podspec.json | 3 +-
.../4.0.11/AppForSaleFramework.podspec.json | 3 +-
.../4.0.12/AppForSaleFramework.podspec.json | 3 +-
.../4.0.13/AppForSaleFramework.podspec.json | 3 +-
.../4.0.14/AppForSaleFramework.podspec.json | 3 +-
.../4.0.15/AppForSaleFramework.podspec.json | 3 +-
.../4.0.16/AppForSaleFramework.podspec.json | 3 +-
.../4.0.17/AppForSaleFramework.podspec.json | 3 +-
.../4.0.18/AppForSaleFramework.podspec.json | 3 +-
.../4.0.19/AppForSaleFramework.podspec.json | 3 +-
.../4.0.23/AppForSaleFramework.podspec.json | 3 +-
.../4.0.24/AppForSaleFramework.podspec.json | 3 +-
.../4.0.25/AppForSaleFramework.podspec.json | 3 +-
.../4.0.26/AppForSaleFramework.podspec.json | 3 +-
.../4.0.27/AppForSaleFramework.podspec.json | 3 +-
.../4.0.46/AppForSaleFramework.podspec.json | 3 +-
.../4.0.47/AppForSaleFramework.podspec.json | 3 +-
.../4.0.57/AppForSaleFramework.podspec.json | 3 +-
.../4.0.58/AppForSaleFramework.podspec.json | 3 +-
.../4.0.59/AppForSaleFramework.podspec.json | 3 +-
.../4.0.60/AppForSaleFramework.podspec.json | 3 +-
.../4.0.61/AppForSaleFramework.podspec.json | 3 +-
.../1.1/BSForegroundNotification.podspec.json | 24 +++++++++++
.../1.3.1/BSSelectableView.podspec.json | 22 +++++++++++
.../0.6.0/DummyTestingPod.podspec.json | 46 ++++++++++++++++++++++
.../1.0.7/ECHttpRequestManager.podspec.json | 30 ++++++++++++++
.../Hyphenate_CN/3.1.5.1/Hyphenate_CN.podspec.json | 42 ++++++++++++++++++++
Specs/OMExtension/0.0.1/OMExtension.podspec.json | 24 -----------
Specs/OMExtension/0.0.2/OMExtension.podspec.json | 24 -----------
Specs/OMExtension/0.0.3/OMExtension.podspec.json | 24 -----------
Specs/OMExtension/0.0.5/OMExtension.podspec.json | 24 -----------
.../{0.0.4 => 1.0}/OMExtension.podspec.json | 4 +-
Specs/OMKit/0.0.6/OMKit.podspec.json | 25 ------------
Specs/OMKit/0.0.7/OMKit.podspec.json | 25 ------------
Specs/OMKit/0.0.8/OMKit.podspec.json | 25 ------------
Specs/Spots/3.0.3/Spots.podspec.json | 44 +++++++++++++++++++++
.../0.1.8/SunbeamTimerService.podspec.json | 30 ++++++++++++++
.../1.5.2/TWNetworkManager.podspec.json | 30 ++++++++++++++
60 files changed, 358 insertions(+), 217 deletions(-)
create mode 100644 Specs/BSForegroundNotification/1.1/BSForegroundNotification.podspec.json
create mode 100644 Specs/BSSelectableView/1.3.1/BSSelectableView.podspec.json
create mode 100644 Specs/DummyTestingPod/0.6.0/DummyTestingPod.podspec.json
create mode 100644 Specs/ECHttpRequestManager/1.0.7/ECHttpRequestManager.podspec.json
create mode 100644 Specs/Hyphenate_CN/3.1.5.1/Hyphenate_CN.podspec.json
delete mode 100644 Specs/OMExtension/0.0.1/OMExtension.podspec.json
delete mode 100644 Specs/OMExtension/0.0.2/OMExtension.podspec.json
delete mode 100644 Specs/OMExtension/0.0.3/OMExtension.podspec.json
delete mode 100644 Specs/OMExtension/0.0.5/OMExtension.podspec.json
rename Specs/OMExtension/{0.0.4 => 1.0}/OMExtension.podspec.json (93%)
delete mode 100644 Specs/OMKit/0.0.6/OMKit.podspec.json
delete mode 100644 Specs/OMKit/0.0.7/OMKit.podspec.json
delete mode 100644 Specs/OMKit/0.0.8/OMKit.podspec.json
create mode 100644 Specs/Spots/3.0.3/Spots.podspec.json
create mode 100644 Specs/SunbeamTimerService/0.1.8/SunbeamTimerService.podspec.json
create mode 100644 Specs/TWNetworkManager/1.5.2/TWNetworkManager.podspec.json
CocoaPods 1.1.0.rc.2 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.1.0.rc.2
Setup completed
localhost:~ keku$
5.查詢
localhost:~ keku$ pod search fmdb
就能夠查詢到了。ios
6.配置 Podfile git
首先定位到項目文件目錄github
cd 項目位置json
而後添加podfile文件:vim podfile (注:在寫該文件的時候要注意格式 ' ' );vim
進入後按i進入插入模式,進行編輯,安裝官方最新的文檔格式:xcode
platform :ios, '8.0'ruby
target '你的項目名稱' dothis
pod 'AFNetworking', '~> 3.0'spa
end命令行
編輯完成後,按ESC退出編輯模式,最後輸入:wq保存並退出文件,此時能夠發如今項目目錄下多了一個Podfile的文件,請注意這個文件必須與.xcodeproj在同一目錄下,
最後:pod install進行安裝便可
CocoaPods庫的跳過更新安裝
pod install --verbose --no-repo-update(跳過更新進行安裝)
pod update --verbose --no-repo-update(跳過更新進行更新)
問題1.
localhost:~ keku$ pod search fmdb
[!] Unable to find a pod with name, author, summary, or descriptionmatching `fmdb`
localhost:~ keku$ rm ~/Library/Caches/CocoaPods/search_index.json
localhost:~ keku$ pod search fmdb
解決方法: rm ~/Library/Caches/CocoaPods/search_index.json
platform :ios,'8.0'target 'DOUYUAPP' dopod 'HMSegmentedControl'pod 'AFNetworking'pod 'SDWebImage'pod 'MJRefresh'pod 'MJExtension'end