skip to Main Content

✖ 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


  1. I used RVM to install ruby and restarted the terminal. It worked.

    Use this to install RVM:

    curl -sSL https://get.rvm.io | bash -s stable
    

    Install the ruby version you would like (2.7.5 in this case):

    rvm install 2.7.5
    

    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:

    bundle install
    cd ios && bundle exec pod install
    

    Link

    Login or Signup to reply.
  2. FIXED

    From React Native documentation:

    React Native uses this version of Ruby.

    To check what is your current version of Ruby

    ruby --version
    

    1. Install rbenv

    To download the rbenv package with Homebrew, run the following command:

    brew install rbenv
    

    Add to ~/.zshrc or to ~/.bash_profile:

    echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
    echo 'eval "$(rbenv init -)"' >> ~/.zshrc
    

    2. Install Ruby

    Install Ruby 2.7.6, please check the latest version:

    rbenv install 2.7.6 
    

    Switch to use Ruby 2.7.6:

    rbenv global 2.7.6
    

    To see the installed versions:

    rbenv versions
    

    3. Check it

    Create a new React Native project:

    npx react-native@latest init TestApp
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search