安装cocoapods: Error installing cocoapods: The last version of activesupport (>= 5.0, < 8) to support ...

Problem Description:

When installing cocoapods on the terminal command line, the following problems may occur:

Error installing cocoapods:
The last version of activesupport (>= 5.0, < 8) to support your Ruby & RubyGems was 6.1.7.6. Try installing it with `gem install activesupport -v 6.1.7.6` and then running the current command again
activesupport requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.

Error installing Cocoon:
The last version of activesupport (>=5.0, <8) that supports Ruby and RubyGems is 6.1.7.6. Try installing it with "gem-install-activesupport -v 6.1.7.6" and then run the current command again
activesupport requires Ruby version >= 2.7.0. The current ruby ​​version is 2.6.10.210.

Solution:

method one:

Install cocoapods using Homebrew. Install Homebrew in the terminal. Enter the command line:

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

After the installation is successful, enter in the terminal:

brew install cocoapods

If an error is reported zsh: command not found: brew, please check the blog:

Homebrew installs cocoapods: zsh: command not found: brew solution

Method Two:

Specify a lower version when installing cocoapods:

sudo gem install cocoapods -v 1.8.4

Thanks: https://juejin.cn/post/6898287392471318535

Guess you like

Origin blog.csdn.net/LYly_B/article/details/132706300