Check out example codes for "Gemfile.lock`. It is likely that you need to grant write permissions for that path.". It will help you in understanding the concepts better.

Code Example 1

sudo chown -R $(whoami):$(whoami) myappfolder

Learn ReactJs, React Native from akashmittal.com