Hey there, I recently had a project in react native for the Apple TV. And i tried to use the react-native-cli to build my project. But while initializing the project i got an unexpected error
error rbenv: version `2.7.7' is not installed (set by /Users/fayis/projects/mytv/.ruby-version)
This message clearly tells that the newer react native requires ruby 2.7.7 but it is not installed on my system. In this case, we had to install the 2.7.7 ruby luckily tools like rbenv make it simple as plucking a flower. So I quickly typed the command rbenv versions to the terminal and I cannot find the version we are looking for. Verson 2.7.7 . That means i don't have the latest rnenv version installed on my system. A quick googling help me to find how to update rbenv and i installed rbenv using HomeBrew on macos. HomeBrew made the job easy. Just a simple command updated my rbenv. You can also find how to update rbenv in other platforms like windows and linux.
brew update && brew upgrade ruby-build
This simple command will do the magic. I set back and relaxed. and thought to write a blog on it and started my writing while the installation is going on. 😁
So after updating/upgrading ruby-build. I installed the ruby version 2.7.7
rbenv install 2.7.7
Then set this version as the global version. You can also set 2.7.7 as the local version only to the specific directory
rbenv global 2.7.7
So this is a small blog post that shows how you can update ruby version on your mac os and fix the error in react native