I'm trying to put a google sign in for my ios app and to do that I need CocoaPods. But when installing it like there own website on terminal I get this:
$ sudo gem install cocoapods
[Password: (*Put in my admin password for my macbook*)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
This is being done on a Macbook Air running High Sierra 10.13.2 (Don't know if you need that info but I've never done anything with cocoapods or ruby before)
I also tried following this link and followed the awnser and installed RVM, or at least I think I did. I just put this in:
ruby -e "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install)"
Well I tried installing CocoaPods after that but still got the same thing.
You might try the following command
sudo gem install cocoapods -n /usr/local/bin
The problem is that gem install
was trying to use /usr/bin
for installing the binaries, which shouldn't be touched for the System Integrity Protection. Since:
A centerpiece is the protection of system-owned files and directories against modifications by processes without a specific "entitlement", even when executed by the root user or a user with root privileges (sudo)
Sudo is without any power in this situation.
Hence the solution uses -n
, from gem help install
it says:
-n, --bindir DIR Directory where binary files are located
in this way you will be able to move the binaries in a more comfortable destination: /usr/local/bin
which stands for programs that a normal user may run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With