1. 程式人生 > >Unable to find a pod with name, author, summary, or description matching `fmdb`

Unable to find a pod with name, author, summary, or description matching `fmdb`

1,先移除掉本地的master,在終端輸入pod repo remove master

2,在終端輸入cd ~/.cocoapods/repos

3,

把github上的spec下載下來,替換路徑~/.cocoapods/repos目錄下的master

接著在終端輸入命令:git clone --depth 1 https://github.com/CocoaPods/Specs.git master,等待下載完畢

4,執行pod install --no-repo-update就能夠正確更新這些第三方庫了

5,

再次輸入pod search 'AFNetWorking'依然是提示找不到,是因為之前pod search的時候生成了search_index.json,把它刪除掉即可輸入命令:rm ~/Library/Caches/CocoaPods/search_index.json回車

6,然後再次輸入pod search 'AFNetWorking'會提示

Creating search index for spec repo 'master'..

然後等待即可,最終會出現相關的第三方庫,並顯示

Creating search index for spec repo 'master'.. Done!

一、安裝 CocoaPods

1、檢視當前ruby源

gem sources -l

2、移除(所有)ruby源

gem sources --remove https://rubygems.org/

3、新增新的ruby源

gem sources -a http://gems.ruby-china.org/

4、安裝cocoapods

sudo gem install cocoapods

出現如下錯誤:

ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/xcodeproj

將命令列換成如下

sudo gem install -n /usr/local/bin cocoapods

5、驗證是否安裝成功

pod search 'AFNetWorking'

二、建立Podfile檔案

1、 cd + 專案路徑下

2、建立Podfile檔案

touch Podfile

3、Podfile 檔案內容

platform :ios, ‘7.0’

target '專案名稱' do


pod '第三方mingcheng'

....

end

4、執行

pod install

5、執行成功後開啟

專案名字.xcworkspace