升級(jí)10.11的系統(tǒng)以后執(zhí)行 pod install 的時(shí)候報(bào)錯(cuò)
: command not found: pod
解決方法如下:
1.檢查gem 的數(shù)據(jù)源?gem sources -l
http://ruby.taobao.org
可能是跟iOS9一樣东揣,Capitan 10.11禁止了http的請(qǐng)求了刨摩,改成https的協(xié)議頭就好了
gem sources --remove http://ruby.taobao.org/
gem sources -a https://ruby.taobao.org/
2.重新安裝pod
sudo gem install cocoapods
如果再次報(bào)錯(cuò)了
ERROR:? While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/xcodeproj
3.使用指令,安裝成功
sudo gem install -n /usr/local/bin cocoapods
如果上面的操作完以后還是報(bào)錯(cuò)的話:如下:
ERROR: ?While executing gem ... (Errno::EPERM)? ? Operation not permitted - /usr/bin/pod
那么你就需要按照下面的操作方法進(jìn)行操作了:
1.
mkdir -p $HOME/Software/ruby
export GEM_HOME=$HOME/Software/ruby
gem install cocoapods
export PATH=$PATH:$HOME/Software/ruby/bin
然后執(zhí)行:
sudo gem update --system
2悴务、install命令執(zhí)行成功后价说,執(zhí)行:
pod setup
執(zhí)行成功顯示:
Setting up CocoaPods master repo
.........
Setup completed
注意:執(zhí)行第一句的時(shí)候會(huì)等待比較久的時(shí)間牧愁,這步其實(shí)是cocapods下載信息到~/.cocoapods 目錄下。查看下載進(jìn)度命令:
cd ~/.cocoapods
du -sh*
然后你可以試下:
pod search AFNetworking
如果以上還是木有解決好你的Pods問(wèn)題彼水,請(qǐng)私信我~(*^__^*)