执行:sudo gem install cocoapods
错误:Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
执行:xcode-select--install
xcode-select -p
rvm -v
错误:no such file or directory
执行:curl -L https://get.rvm.io | bash -s stable 进行安装
安装完成:Thanks for installing RVM 🙏
Please consider donating to our open collective to help us maintain RVM.
切换到RVM环境:source ~/.rvm/scripts/rvm
查看版本:rvm -v
rvm (1.29.12 版本号) (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
在rvm环境中查询已经安装的ruby
rvm list
# No rvm rubies installed yet. Try 'rvm help install'.
发现rvm路径下里并没有ruby环境
查看所有ruby版本:
rvm list known
执行:
rvm install 3.0.0(要安装的版本号)
不添加版本号会报错:Can not use or install 'all' rubies. You can get a list of installable rubies with 'rvm list known'.
安装完成:
Install of ruby-3.0.0 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
查看是否安装成功:
rvm list
安装成功:
=* ruby-3.0.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
执行:sudo gem install cocoapods
安装成功
网友评论