Jekyll Bundle Error

When creating a new jekyll site, the following error occurs:

Retrying download gem from https://rubygems.org/ due to error (1/4): Bundler::PermissionError There was an error while trying to write to /usr/share/gems/cache/. It is likely that you need to grant write permissions for that path.

The error message is indicating that there’s a permission issue when to write to the gem cache directory (/var/lib/gems/3.0.0/cache). This often happens because some of the gem files are owned by root or another user, or the permissions are set incorrectly.

Run the following command:

  sudo chown -R $USER /usr/share/gems/

This command changes the owner of all files and directories under /usr/share/gems/ to the current user. If changing the owner doesn’t solve the problem, try to change the permissions of directory.

Posted by

Horacio

💻 LA-based Indie Hacker, Full-stack Developer | MSc Cybersecurity | Building a SaaS startup 🚀