安装cocoapods: 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`问题解决

问题描述:

在终端命令行安装cocoapods时,可能出现如下问题:

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.

安装茧时出错:
支持Ruby和RubyGems的activesupport(>=5.0,<8)的最后一个版本是6.1.7.6。尝试使用“gem-install-activesupport-v 6.1.7.6”安装它,然后再次运行当前命令
activesupport需要Ruby版本>=2.7.0。当前的ruby版本是2.6.10.210。

解决方法:

方法一:

使用Homebrew安装cocoapods.在终端安装Homebrew.输入命令行:

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

安装成功后在终端输入:

brew install cocoapods

如果报错zsh: command not found: brew,请查看博客:

Homebrew安装cocoapods: zsh: command not found: brew解决方法

 

方法二:

安装cocoapods时指定个低版本:

sudo gem install cocoapods -v 1.8.4

 

 

鸣谢:https://juejin.cn/post/6898287392471318535

posted @ 2023-09-05 09:51  临易  阅读(453)  评论(0编辑  收藏  举报