✖ Installing Bundler
error Your Ruby version is 2.6.8, but your Gemfile specified 2.7.4
✖ Installing Bundler
error Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
But my Ruby version is 2.7.5
I tried run below commands:
yarn global remove react-native-cli "after install again"
rvm install ruby/latest
npm install -g @react-native/cli
But nothing works 🙁
2
Answers
I used RVM to install ruby and restarted the terminal. It worked.
Use this to install RVM:
Install the ruby version you would like (2.7.5 in this case):
This is an open issue in the RN repo. Looks like react-native-cli just cannot figure out that the Ruby version is indeed correct. You can avoid the CLI command by going to the project directory and running:
Link
FIXED
From React Native documentation:
To check what is your current version of Ruby
1. Install rbenv
To download the rbenv package with Homebrew, run the following command:
Add to
~/.zshrc
or to~/.bash_profile
:2. Install Ruby
Install Ruby 2.7.6, please check the latest version:
Switch to use Ruby 2.7.6:
To see the installed versions:
3. Check it
Create a new React Native project: