未知的ruby解释器版本(不知道如何处理):>=2.7.5。反应本机

Eng*_*faq 5 ruby xcode ios react-native

npx react-native init myProjectName当我导航到它所说的项目时,我已经使用命令创建了一个新项目

Unknown ruby interpreter version (do not know how to handle): >=2.6.10.
Run Code Online (Sandbox Code Playgroud)

这是 Gemfile

source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '>= 2.6.10'

gem 'cocoapods', '>= 1.11.3'
Run Code Online (Sandbox Code Playgroud)

我还用rvm安装了多个ruby版本

apple@Apples-MacBook-Pro fastVpn % rvm list          
   ruby-2.7.4 [ x86_64 ]
=* ruby-2.7.5 [ x86_64 ]
   ruby-2.7.6 [ x86_64 ]
Run Code Online (Sandbox Code Playgroud)

但仍然有同样的问题

spi*_*ann 9

rubya 中的方法需要Gemfile特定的 Ruby 版本,并且无法处理像'>= 2.6.10'.

改变

ruby '>= 2.6.10'
Run Code Online (Sandbox Code Playgroud)

ruby '2.7.5'
Run Code Online (Sandbox Code Playgroud)

  • 那个工作罚款。但在最新的react-native版本中,它就像这样 ruby​​ '>= 2.6.10' (3认同)