It is likely that you need to grant write permissions for that path code example
Example: Gemfile.lock`. It is likely that you need to grant write permissions for that path.
sudo chown -R $(whoami):$(whoami) myappfolder
sudo chown -R $(whoami):$(whoami) myappfolder