0
votes

I'm new to ruby version manager and when i tried to install rails after installing it, I get this error . I tried to search other SO questions as well but didn't want to re-install ruby version manager. Even though when I try sudo for installation, it doesn't work.

The error I get is as follows:"ERROR: While executing gem ... (Errno::EACCES)Permission denied @ dir_s_mkdir - /home/sunil/.gem/specs"

1
Though it should not be needed normally, but try using sudoHungryCoder

1 Answers

0
votes

I would do this:

  1. ls -ld /home/sunil/.gem/specs to check that folder permissions.
  2. whoami to compare current user with /home/sunil/.gem/specs permissions
  3. Maybe chown -R sunil:sunil ~/.gem to change owner in case .gem directory is not owned by sunil.
  4. Maybe chmod -R u+rwX,go+rX,go-w ~/.gem to change permissions.