skip to Main Content

[enter image description here](https://i.stack.imgur.com/M5896.png).

After successfully installed all of the aboves I was going to create react-native app using npx react-native init AwesomeProject comand and faced Your Ruby version is 2.6.8, but your Gemfile specified 2.7.5 error is also given in attached file. please check it and help me to suggest the way to solved.

4

Answers


  1. It seems like you need to upgrade your machines ruby installation from 2.6.8 to 2.7.5. If you have rbenv installed you can install multiple versions of ruby onto your machine and switch between them.

    rbenv install 2.7.5

    Login or Signup to reply.
  2. I have followed these instructions to solve this issue:

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

    2. Install Ruby: followed rbenv Official Github Repo link to install the required version of ruby

    3. Install CocoaPods: sudo gem install cocoapods
      CocoaPods in fixed location: sudo gem install -n /usr/local/bin ffi cocoa pods

    After the environment setup, it works perfectly.

    Those users who use the MacBook air M1, Please make sure that your terminal is working on the Rosetta

    Finder > Go > Utilities > Terminal > GetInfo

    I attached the image for your reference.

    Login or Signup to reply.
  3. Ruby 2.6.8 is Mac system Ruby version. So we should install Ruby 2.7.5 manually. We can install it with Chruby.

    1. brew install ruby-install chruby

    2. open -e ~/.zshrc

      Add configuration commands for Chruby:

      source /usr/local/share/chruby/chruby.sh

      source /usr/local/share/chruby/auto.sh

      chruby ruby-2.7.5

    3. ruby-install ruby 2.7.5

    4. check ruby version ruby -v

    Login or Signup to reply.
  4. follow only 3 steps:

    1. rvm install ruby-2.7.5

    2. rvm –default use 2.7.5

    3. rvm use system

    now close and re-open terminal then check ruby version. hopefully this will be your expected version there.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search