升級 Ruby 環境
$ gem update --system
$ sudo gem update --system
更換 Ruby 鏡像
$ gem source -l
$ gem source --remove https:// (上面運行的結果)
$ gem source -a https://gems.ruby-china.org/
安裝 CocoaPods
$ sudo gem install cocoapods
$ sudo gem install -n /usr/local/bin cocoapods
$ pod setup
安裝過程慢 command + n 新建終端窗口
搜索第三方庫
$ pod search CorePlot
工程中創建 Podfile 文件:
工程目錄下
$ touch Podfile
$ vim Podfile
按 i 進入INSERT
platform : ios, '9.0'
target 'MotionGraphs' do
pod 'CorePlot', '~> 2.2'
end
依次按 esc 、 : 、 wq 退出并保存
$ pod install