1.安装 hombrew:
/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"
设置全局变量
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/wangzhengwei/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
2.安装ruby
brew install ruby
设置全局变量
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
全局变量立即生效
source xxxx.zprofile
3.安装cocoapods
sudo gem install -n /usr/local/bin cocoapods
sudo gem install cocoapods
(废弃 不知道装哪去了 会报错 pod not found...)
如果报错要升级ruby
brew upgrade ruby
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/
网友评论