xxxxxxxxxx
export GEM_HOME="$HOME/.gem"
# then run your
gem install
xxxxxxxxxx
# Go to the directory where the relevant files are located
cd /path/to/project
# Recursively change permissions for the entire directory
chmod -R 755 .
# If necessary, you may also need to change ownership of the files
# Replace [username] with your actual username
sudo chown -R [username] .
# Try executing the gem command again
gem <gem_command>