1.安装ruby
1>安装 RVM
RVM: Ruby Version Manager, Ruby的版本管理器,包括Ruby的版本管理和Gem库管理(gemset)
curl -L get.rvm.io | bash -s stable
2>安装home-brew(切记先安装home-brew,再安装ruby!!)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
如果有错误lion – Homebrew permissions & multiple users needing to brew update – Ask Different
sudo chgrp -R admin /usr/local
sudo chmod -R g+w /usr/local
brew update
卸载homebrew(如果想卸载就用这个)
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
3>查询rvm中的ruby版本
rvm list known
4>再安装ruby版本(最新版本2.3.0)
rvm install 2.3.0
ruby ,brew,都是可以自己去官网下载安装的,cocopods
2.安装CocoaPods
1>安装cocoapods(普通版本)
sudo gem install cocoapods
2>更新框架库
pod setup
可以查看框架镜像库的cd ~/.cocoapods
3>更新cocoapods版本(测试版本,仅供特定条件)
sudo gem install cocoapods --pre
4>指定安装cocoapods版本
sudo gem install cocoapods --version 1.0.1
brew update