Skip to main content

Command Palette

Search for a command to run...

How to fix "error Your Ruby version is 2.6.8, but your Gemfile specified 2.7.6" in React Native

Updated
1 min read
How to fix "error Your Ruby version is 2.6.8, but your Gemfile specified 2.7.6" in React Native
C

React native Developer, Life long learner, Jesus Christ lover.

I encountered this issue when I was trying to spin up a new React Native project. This is how I fixed it.

  • First, update brew
brew update
  • Use brew to install ruby-build
brew install ruby-build
  • Use brew to install rbenv
brew install rbenv
  • Then go ahead to install the rbenv version you need. In our case, it is version 2.7.6
rbenv install 2.7.6
  • Next, set the new version to be global
rbenv global 2.7.6
  • Finally, export the following configurations to define rbenv as default global ruby
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
  • And
echo 'eval "$(rbenv init -)"' >> ~/.zshrc

Finally kill the terminal and restart it.
Now you can succesfully create a new React Native project.

More from this blog

Chidera

22 posts

React Native Developer