I'm trying to correct the issue in my react native setup, the issue seems to be ruby. To clarify I'm on a Mac M1
So i installed rvm, installed rvm 2.7.6 (which is the current version of ruby react native uses, information taken on their website). I did this command on Rosetta2 because it was crashing in a non-rosetta terminal : rvm install 2.7.6
The rest of the command are NOT done in Rosetta2.
Then I added rvm to the my ~/.zshrc file
export PATH="$PATH:$HOME/.rvm/gems/ruby-2.7.6/bin"
export PATH="$PATH:$HOME/.rvm/bin"
well actually, I added those two lines with the command rvm get stable --auto-dotfiles
Sometimes, I still get this error, I have to admit that I don't know why, I understood that the line above was supposed to add it to the path. Warning! PATH is not properly set up, /Users/myusername/.rvm/gems/ruby-2.7.6/bin is not at first place.
Anyway, I do this then :
rvm --default use 2.7.6
ruby --version
the last line return this : ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-darwin22]
which sounds okay to me, so I try to init a new project with react native : npx react-native init NewProject
Then I got something suspicious, react native telling me to download cocoapods either with gem or home-brew, but I already did it with gem. Anyway I select download with gem (or Homebrew, both result have the same error). And I got this error : Your Ruby version is 2.6.10, but your Gemfile specified 2.7.6
Re-checked the ruby version, still the 2.7.6, I'm missing something, and maybe more than just one thing but I've been on a lot of post and stuff and can't find the solution so I'm trying here.