ruby的版本號:
https://gorails.com/setup/osx/10.12-sierra
更新ruby、gem
1.安裝Homebrew
http://brew.sh/index_zh-cn.html
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.安裝rvm
https://rvm.io/rubies/installing
2.1.安裝rvm$ ? ? ? ? ? ? ? ? ? ?curl -L get.rvm.io | bash -s stable
2.2.裝載rvm$ ? ? ? ? ? ? ? ? ? ?source ~/.rvm/scripts/rvm
2.3 安裝xcode命令行 ? ?
?xcode-select --install
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
2.4.安裝2.3.0版本ruby$ ? ?rvm install 2.3.3
2.5.將2.3.0設為默認$ ? ? ? ?rvm use 2.3.3 --default
3.因為cocoaPods需要用Gem進行安裝,所以如果系統(tǒng)比較舊需要先升級Gem
sudo gem update --system
4.sudo gem install cocoapods
sudo gem install -n /usr/local/bin cocoapods
While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
sudo chmod 777 /Library/Ruby/Gems/2.0.0
2.查看數據源
gem sources -l
3.移除與添加。只保證只有ruby這個源稼跳。
gem sources --remove http://ruby.taobao.org/
gem sources -a https://gems.ruby-china.org/ ?
2. 執(zhí)行? pod update 遇到問題
出現(xiàn):Performing a deep fetch of themasterspecs repo to improve future performance
解決方案: 刪除索引庫,重新安裝Pod,執(zhí)行終端命令
rm -rf ~/.cocoapods/repos
pod setup
cd ~/.cocoapods/
du -sh *? 【查看正在下載的文件夾的大小】
3.執(zhí)行pod repo update更新本地倉庫
比較不卡頓。偶爾會比較慢,耐心等待一下碧聪。
pod install --verbose --no-repo-update
pod update --verbose --no-repo-update