1.打开网页 http://brew.sh/
控制台命令输入
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
gem sources --remove https://rubygems.org/
gem sources -a https://ruby.taobao.org/
gem sources -l
sudo gem install cocoapods
2.控制台命令输入 brew install ruby
3.控制台命令输入 brew install cocoapods
4.安装成功
podfile
platform :ios,'7.0'
use_frameworks!
target ‘cocoapodstest’ do
pod 'AFNetworking', '~> 3.1’
end