直接執(zhí)行sudo gem install cocoapods灾前,會(huì)報(bào)錯(cuò)容握, ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod
替換成:sudo gem install -n /usr/local/bin cocoapods
然后又報(bào)錯(cuò)
WARNING: Unable to pull data from 'http://ruby.taobao.org/': bad response Not Found 404 (http://ruby.taobao.org/specs.4.8.gz)
網(wǎng)上查才知道taobao鏡像已經(jīng)改成https的了。
所以解決方案如下:
1、替換為淘寶鏡像,注意是https
gem sources -a https://ruby.taobao.org/
2共虑、執(zhí)行以下命令
sudo gem install -n /usr/local/bin cocoapods