While trying to create a react native CLI app on M1 Mac an error occured while installing Ruby Gems:
✖ Installing Ruby Gems
error There was an error while trying to write to
/Users/maciejwiacek/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/versions.61581.tmp.
It is likely that you need to grant write permissions for that path.
✖ Installing Ruby Gems
error Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/environment-setup?os=macos&platform=android and follow the React Native CLI QuickStart guide for macOS and iOS.
I tried reinstalling my macos, cocoapods, ruby versions, homebrew, watchman etc.
Do you have ruby and cocoapods? The official guide says that you would need to use
sudo
in some cases. I'm using Ruby Version Manager installed thanks to this guide, but previously I just get my work done withsudo
, even if many discourages this practice.