昨晚回家以後開始升級系統到10.11,下載了一整個晚上以後終於在早上下載完畢,早上帶到公司,想查一個第三方庫的時候卻遇到了問題:git
guoyufudeMacBook-Pro:~ GuoYufu$ pod search VKVideoPlayer -bash: pod: command not found
接着嘗試:github
guoyufudeMacBook-Pro:~ GuoYufu$ gem sources -l *** CURRENT SOURCES *** http://ruby.taobao.org/
這裏沒錯。ruby
guoyufudeMacBook-Pro:~ GuoYufu$ pod help -bash: /usr/local/bin/pod: /usr/local/opt/ruby/bin/ruby: bad interpreter: No such file or directory
而後基本肯定是系統升級以後致使CocoaPods不能正常使用。繼續查找解決方案:bash
1.首先考慮從新安裝CocoaPods:curl
guoyufudeMacBook-Pro:~ GuoYufu$ sudo gem install cocoapods Password: ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod
失敗。ide
2.繼續根據報錯信息查找解決方法,運行查到的:url
sudo gem install -n /usr/local/bin cocoapods
提示:spa
Successfully installed cocoapods-0.38.2 Parsing documentation for cocoapods-0.38.2 1 gem installed
莫非成功了?blog
嘗試:it
pod search VKVideoPlayer
能夠正常執行。
嘗試更新一下CocoaPods的版本:
guoyufudeMacBook-Pro:~ GuoYufu$ sudo gem install cocoapods Password: ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod
仍是報錯。
3.索性按照最初安裝的步驟所有來一遍:
安裝Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安裝Ruby後從新安裝CocoaPods
brew install ruby
sudo gem install cocoapods
終於再也不報錯了。