1.安装cocoapods
sudo gem install cocoapods
出现:ERROR: Could not find a valid gem 'cocospods’ (>= 0), here is why:
Unable to download data from http://ruby.taobao.org/ - bad response Not Found 404 (http://ruby.taobao.org/latest_specs.4.8.gz)
将http 替换成 https
1.gem sources --removehttp://ruby.taobao.org/
2.gem sources -ahttps://ruby.taobao.org/
3.查看源对不对
gem sources -l
然后又出现: ERROR:While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/xcodeproj
之后输入下面代码解决:
sudo geminstall-n /usr/local/bincocoapods--pre