Mac M2安装cocoapods

sudo gem install cocoapods

报错:You don't have write permissions for the /Library/Ruby/Gems/x.x.x directory

此处不推荐 sudo 安装!!!

1.安装新的homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

如果出现443连接问题,设置一下代理

Mac终端配置代理_mac export_星宿老仙的博客-CSDN博客

2.安装新的ruby

可参考:The fastest and easiest way to install Ruby on a Mac in 2023

3.使用 brew intall cocoapods

4.pod --version查看pod版本

你可能感兴趣的:(macos,cocoapods)