Home > Software design >  Building new project gives error rbenv: version `2.7.6' is not installed
Building new project gives error rbenv: version `2.7.6' is not installed

Time:02-01

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

CodePudding user response:

When you are creating a project . By default it get created at react-native latest version whihch is 0.71 requires a ruby version of 2.7.6 .

You have to install the ruby of that specific version. You can install it by following this link

CodePudding user response:

The error is fairly self explanatory. I'll assume that Ruby 2.7.6 is not installed. To install the Ruby version run:

rbenv install 2.7.6

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 a rbenv command as well:

rbenv local 2.7.6

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.

ruby --version

Should print 2.7.6

  • Related