简体   繁体   中英

Building new project gives error rbenv: version `2.7.6' is not installed

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

on running rbenv install 2.7.6 it shows like this在此处输入图像描述

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM