user10166622
user10166622

Reputation:

Why can't I uninstall CocoaPods?

I have never used CocoaPods before. I have installed CocoaPods gems and now I want to delete them but it won't allow me to.

I've attempted to uninstall them by running the command,

$ gem uninstall cocoapods

Then it asked me if I wanted to remove executables [Yn]. I selected Y. I expected it to remove the CocoaPods. Instead it gave me the error:

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

What does this error mean and how can I remove the CocoaPods?

Upvotes: 4

Views: 5515

Answers (1)

Aaron Brager
Aaron Brager

Reputation: 66242

Your current user probably doesn't have write permissions to /usr/local/bin. If you want, you can check the permissions like so:

$ ls -ld /usr/local/bin
drwxrwxr-x  573 aaronbrager  admin  18336 Dec 14 09:32 /usr/local/bin

And see who you're logged in as like so:

$ whoami
aaronbrager

In your case, I'm guessing they're different.

Anyway, you can

  • fix the permissions (using chown and chmod),
  • change users (login as someone else), or
  • just use sudo, assuming you have the admin password

I'm guessing this will be easiest for you:

sudo gem uninstall cocoapods

Upvotes: 3

Related Questions