电脑:mac 14.5
pods 从1.15.2升级到 1.16.2
sudo gem install cocoapods 报错
ERROR: Error installing cocoapods:
The last version of securerandom (>= 0.3) to support your Ruby & RubyGems was 0.3.2. Try installing it with `gem install securerandom -v 0.3.2` and then running the current command again
securerandom requires Ruby version >= 3.1.0. The current ruby version is 2.6.10.210.
这里的错误是说需要升级ruby
1、运行:sudo gem install securerandom -v 0.3.2
2、运行。 brew install rbenv
3、运行 rbenv global 3.1.0
如果在这里直接运行 sudo gem install cocoapods 有可能继续报错因为 这里的ruby 还是2.0.6 不信的可以试试
4、运行 eval "$(rbenv init -)"
5、运行 rbenv global 3.1.0
6、运行 source ~/.bashrc
7、运行 ruby -v 查看版本是否是3.1
到这个时候算成功