问题
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
回答1:
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
- github.com/postmodern/ruby-install together with github.com/postmodern/chruby (my personal favourite), rvm.io is also very popular
- The benefit of this approach is that you also can switch Ruby version whenever you like (and as mentioned above;
more secureless insecure..)
回答2:
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!
回答3:
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.
回答4:
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.
回答5:
You can solve this in 2 ways.
- Add CocoaPods folder on ~/Library/Caches/CocoaPods then try
pod install
OR
- Give full permission on you project
- cd your-project
- chmod -R 777 .
- cd ios
- pod install
来源:https://stackoverflow.com/questions/51181915/cocoapods-folder-does-not-exist-permissions-error