52

I'm on Mac and I'm trying to install Sass using the command in terminal, "sudo gem install sass". I then enter my password, and everything works fine until this pops up,

"ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/bin directory."

I do use sudo, but it still doesn't work, and it's one of those things that you can't give yourself read & write permissions to. Any ideas?

Thanks,

Wade

Wade M.
  • 521
  • 1
  • 4
  • 3

4 Answers4

112

/usr/bin is protected by system integrity protection and is not writeable by anybody even root. You need to run:

sudo gem install -n /usr/local/bin sass

to install into a writeable directory

Alan Birtles
  • 32,622
  • 4
  • 31
  • 60
14

For generamba:

sudo gem install -n /usr/local/bin generamba
Mihail Salari
  • 1,471
  • 16
  • 17
5

For CocoaPods:

sudo gem install -n /usr/local/bin cocoapods
David Buck
  • 3,752
  • 35
  • 31
  • 35
4

I used the same for bundler.

sudo gem install -n /usr/local/bin bundler.

It works.

Amit
  • 2,389
  • 22
  • 29