gem在react本机错误上安装cocoapods:cocoapods-core需要Ruby版本>=2.6.目前的



我有一个react原生项目,目前正在使用cocoapods v1.10.1我想将该版本升级到cocoapods v1.11.2。

当我运行以下命令时

gem install cocoapods

我得到这个错误:

Error installing cocoapods:
There are no versions of cocoapods-core (= 1.11.2) compatible with your Ruby & RubyGems. Maybe try installing an older version of the gem you're looking for?
cocoapods-core requires Ruby version >= 2.6. The current ruby version is 2.4.1.111.

更新ruby版本。检查一下你用的是哪颗红宝石。

所以我建议使用rbenv。它是ruby版本管理器。并使用rbenvruby版本设置gem、pod。

最新更新