on building my new react native project with react native 0.70 using npx react-native init command it gives error while installing bundler that
rbenv: version `2.7.6′
is not installed (set by /Users/rahul/Documents/projects/reactNativeProjects/project1/.ruby-version)
current ruby version 2.7.5p203 on ruby -v
rbenv version: 1.2.0-48-g6717c62 on rbenv -v
2
Answers
When you are creating a project . By default it get created at react-native latest version whihch is
0.71
requires a ruby version of2.7.6
.You have to install the ruby of that specific version. You can install it by following this link
The error is fairly self explanatory. I’ll assume that Ruby 2.7.6 is not installed. To install the Ruby version run:
Once installed update the version you’re using. Assuming you’re in your project folder you can update the local version by changing the
.ruby-version
file. This can be done with arbenv
command as well:Which will update the
.ruby-version
file for you (assuming that you’re in the correct working directory).Finally validate that the new Ruby version is installed and in use.
Should print
2.7.6