Learn Courses My Dashboard

REVISION: CocoaPod install

I’ve tried several solutions online none have worked yet. Is anyone familiar with installing CocoaPods on macOS Catalina 10.15.7. I keep getting

ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory.

Does anyone have any solutions I could try?

If you have a Mac equipped with an M1 chip then you are best advised to install HomeBrew.

Open terminal and paste in the following command string:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Now install cocoapods using the following command:

brew install cocoapods

I believe that you can also install cocopods on an Intel Mac the same way but I have not attempted that myself so I can’t be sure that it will work.

1 Like

Thank you so much for the reply. In the end I had to install the latest version of Ruby first. If any body else has a Gem::FilePermissionError I suggest running the command

$ ruby -v

(you do not enter the $ it’s just a start command indicator for when you share commands in terminal.
On MacOS you access terminal by holding the “command” and “spacebar”. Then type terminal in the search bar. Im not sure about any other system since I have Mac.)

If the version displayed is not the current version on the Ruby developer site (Ruby Programming Language) then ,again if you have Mac, use this link
Install Ruby 3.1 · Mac · Complete Guide · 2022 to install ruby. Some steps may require additional research (especially if you’re a newbie like me) but the instructional helps point you in the right directions. If anyone has this problem in the future and wants more detailed info on how I did it just comment!

I have macOS Catalina 10.15.7


Ah yes, there is always some precursor to getting it to install successfully. I don’t remember having to update Ruby but I may have. There was a lot going on at the time when I was trying to install cocoapods on my M1.

1 Like