Mac OS X EI Capitan系统下cocoapods无法安装

系统升级到Mac OS X EI Capitan后,使用命令:sudo gem install cocoapods,安装cocoapods,出现以下错误:

ERROR:Could not find a valid gem 'cocoapods' (>= 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)

解决方法:

1.  gem sources --remove http://ruby.taobao.org/

2.  gem sources -a https://ruby.taobao.org/

再次尝试:sudo gem install cocoapods,出现新的错误:

ERROR:While executing gem ... (Errno::EPERM)

Operation not permitted - /usr/bin/xcodeproj

解决方法:

sudo gem install -n /usr/local/bin cocoapods

OK!

你可能感兴趣的:(Mac OS X EI Capitan系统下cocoapods无法安装)