skip to Main Content

I have already gone through this post

I am facing this issue on my new react-native project version 0.71.1 while enabling the new architecture for iOS

I have done all the below steps

$ brew update
$ brew install ruby-build
$ brew install rbenv

$ rbenv install 2.7.6
$ rbenv global 2.7.6

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

When I run ruby --version I get ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-darwin22] which is the correct ruby version required to enable new architecture on iOS

but when I run bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install I still get error saying

Your Ruby version is 2.6.10, but your Gemfile specified 2.7.6

enter image description here

What else am I missing?

I have also raised the issue in react native’s GitHub repo. This might help in understanding in what I have already tried

3

Answers


  1. Chosen as BEST ANSWER

    I was able to resolve my issue by running bundle install --redownload. It Forces a redownload of all gems on the gemfile, assigning them to the new bundler


  2. The Rbenv documentation can define a version file named .ruby-version inside your project folder. Perhaps you have this file with a specific version number inside.

    This setting overrides your default ruby version.

    Link to Rbenv-Repo: https://github.com/rbenv/rbenv

    Update: After lots of suggestion, we came to the conclusion. The command bundle install --redownload updates the local bundler and everything is fine. 🙂

    Login or Signup to reply.
  3. Just change your ruby version in GemFile to 2.6.10 and then try it.

    You’ll find your GemFile in your project’s root directory

    enter image description here
    enter image description here

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