從SVN上更新工程以後運行工程提示錯誤:git
The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.`
平時只要在終端輸入pod install就好,可是今天卻出錯了,提示[!] Unable to find a specification for `FMDB`
![](http://static.javashuo.com/static/loading.gif)
而後我在終端輸入pod search fmdb,結果居然提示:[!] Unable to find a pod with name, author, summary, or description matching `fmdb`
![](http://static.javashuo.com/static/loading.gif)
接着我就輸入pod setup手動安裝,先出現Setting up CocoaPods master repo,可是它又提示錯誤:github
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
$ /usr/bin/git -C /Users/lv/.cocoapods/repos/master pull --ff-onlyjson
真的是無語了,而後在github上找到了答案.this
先移除掉本地的master,在終端輸入pod repo remove master
spa
而後轉到路徑下,在終端輸入cd ~/.cocoapods/repos
3d
再把github上的spec下載下來,替換路徑~/.cocoapods/repos目錄下的mastercode
接着在終端輸入命令:git clone --depth 1 https://github.com/CocoaPods/Specs.git master,等待下載完畢blog
OK,如今再執行pod install --no-repo-update就可以正確更新這些第三方庫了.ip
可是再次輸入pod search fmdb依然是提示找不到,是由於以前pod search的時候生成了search_index.json,把它刪除掉便可輸入命令:rm ~/Library/Caches/CocoaPods/search_index.json回車ci
而後再次輸入pod search fmdb會提示
Creating search index for spec repo 'master'..
而後等待便可,最終會出現相關的第三方庫,並顯示
Creating search index for spec repo 'master'.. Done!
整個過程參考瞭如下資源,感謝🙏
http://blog.cocoachina.com/article/29127
http://www.jianshu.com/p/799ff45805f2
http://stackoverflow.com/questions/21022638/pod-install-is-staying-on-setting-up-cocoapods-master-repo