每次時間就了都會忘記粗悯,記錄一下。
網(wǎng)上花里胡哨亂七八糟。按照這個只需要4步安裝完成葡缰。
1.安裝 Homebrew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
最好選清華的源。中科大好像有點問題忱反。
其中會出現(xiàn)錯誤泛释,按照提示執(zhí)行 run后面的命令:
2.執(zhí)行brew install ruby
這里如果出現(xiàn):Error: Command failed with exit 128: git
執(zhí)行:unset HOMEBREW_BOTTLE_DOMAIN
然后重新:brew install ruby就好了
可能出現(xiàn)錯誤:fatal: not in a git directory
Error: Command failed with exit 128: git
解決方案:順序執(zhí)行
git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services
git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-caskgit
重新執(zhí)行:brew install ruby
3.sudo gem update --system
4.sudo gem install -n /usr/local/bin cocoapods
如果在12遇到權(quán)限問題:
升級 cocoapods 報錯
報錯 You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/
用命令
sudo gem install -n /usr/local/bin cocoapods
安裝或升級cocoapods 報錯,You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/
解決辦法:
用命令
brew install cocoapods
進行升級或安裝
就此安裝完畢温算,拒絕花里胡哨的亂七八糟的操作怜校。