0

I use Flutter and I want to test my app on an iPhone emulator or on an iPhone. I get the error to install Cocoapods. When I try to install Cocoapods I get the following error:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/bin directory.
rmlockerd
  • 3,776
  • 2
  • 15
  • 25

1 Answers1

0

Using the default Ruby install will require you to use sudo when installing gems. (This is only an issue for the duration of the gem installation, though.)

$ sudo gem install cocoapods

If you encounter any problems during installation, please visit this guide.

But the best practice is Never install gems with sudo

CKR666
  • 1,497
  • 1
  • 13
  • 10
  • Okay. Try adding eval "$(rbenv init -)" at the end of your .bash_profile. If that file doesn't exist in your home directory, create it. Then open a new shell and try the doctor again. Should be working! – CKR666 Oct 11 '20 at 17:00
  • https://stackoverflow.com/questions/18599889/error-while-executing-gem-gemfilepermissionerror/25716203#25716203 – CKR666 Oct 11 '20 at 17:04
  • Thanks. Iam not that. much into the macOS basics so how do i create it ore which file type should it be? – Hole Closer Oct 11 '20 at 17:05