nachshon f
nachshon f

Reputation: 3680

CocoaPods folder does not exist / permissions error

I'm new to CocoaPods, I tried running 'pod install' on my Mac to install my pod, but I'm getting a permissions error with the folder /Users/username/Library/Caches/CocoaPods. That folder doesn't even exist! Did I accidentally delete it at one point? How do I restore it? There is however a folder called /Library/Caches but its not under my username, its at the root.

I'm a little confused. If someone can just direct me in the right direction, I would really appreciate it.

Here is the full error message:

Errno::EACCES - Permission denied @ dir_s_mkdir - /Users/nachshonfertel/Library/Caches/CocoaPods

Upvotes: 5

Views: 7709

Answers (7)

Vadim Teselkin
Vadim Teselkin

Reputation: 854

Set the correct permissions for the folder: as in the picture. (Sorry for the localization)

right permissions

Upvotes: 0

Redmen Ishab
Redmen Ishab

Reputation: 2339

I managed to solve my issue in following steps:

  1. Create CocoaPods folder (if it doesn't exist) cd ~/Library/Caches && mkdir CocoaPods

  2. Give access to CocoaPods folder sudo chmod 777 Cocoapods

  3. Create Pods folder cd CocoaPods && mkdir Pods
  4. Give access to Pods folder sudo chmod 777 Pods

I hope it helps !

Upvotes: -1

vendeeshwaran Chandran
vendeeshwaran Chandran

Reputation: 1411

You can solve this in 2 ways.

  1. Add CocoaPods folder on ~/Library/Caches/CocoaPods then try

pod install

OR

  1. Give full permission on you project
  1. cd your-project
  2. chmod -R 777 .
  3. cd ios
  4. pod install

Upvotes: 7

user310563
user310563

Reputation: 13

I solved the problem creating the missing folder Users (in my case the error was Permission denied @ dir_s_mkdir - /Users/Users) and give full permission to all users.

Upvotes: 0

Jacobo Koenig
Jacobo Koenig

Reputation: 12514

I had been struggling with this issue for a while. For some reason, in my case the problem was that the folder ~/Library/Caches/CocoaPods was not there, and cocoapods wasn't able to create it when running 'pod install'. Hence the permission error.

After trying several things, I created that folder manually (which prompted for my password), ran 'pod update' and my problem was fixed!

Hope this saves someone some trouble.

Upvotes: 0

nachshon f
nachshon f

Reputation: 3680

Turns out it was a permissions error. And the folder I thought didn't exist, was hidden in finder > Go > (Hold Down Option Key) Library

Took me 2 full days to finally figure it out!

Upvotes: 1

buren
buren

Reputation: 742

Are you using system Ruby or have you installed Ruby with sudo?

You basically have 2 options:

  • use sudo pod install

    • Probably the easiest/fastest way for you go forward
    • This typically causes more problems than Ruby being owned by non-root
    • When you install packages they will have sudo access!
  • Install Ruby, non-sudo; you can try

Upvotes: -1

Related Questions