最近刚入手M1电脑,配置过程有点辛酸,把过程记录一下,希望能够帮到有需要的小伙伴。
homebrew的安装
homebrew的安装命令如下:
/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"
然后根据提示操作就行了,执行结束后会有个提示,让你执行下相关的命令,按照要求复制粘贴就行了,参考网址:https://zhuanlan.zhihu.com/p/341831809
cocoapod的安装
直接执行:
sudo gem install -n /usr/local/bin cocoapods
安装完成后执行:
pod setup
如果网速比较慢的话,也可以把提前把仓库下载下来,网址:https://github.com/CocoaPods/Specs.git
放在~/.cocoapods/repos/下,然后将仓库的文件夹名字改成cococapods也可以
参考网址:https://zhuanlan.zhihu.com/p/80688467
安装ffi插件
为了兼容x86 _64,需要安装下ffi插件,具体命令如下:
sudo gem install ffi
参考网址 :https://www.jianshu.com/p/a0e5e761944c
执行pod install如果仍然出现错误的话,需要执行如下命令行:
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
执行完即可正常的pod install了