3

I am getting an error when running pod install on my project. The error is seen as a permission error:

Errno::EACCES - Permission denied - 
/Users/**/.rbenv/versions/1.9.3-p327/lib/ruby/1.9.1/fileutils.rb:1406:in `unlink'
/Users/**/.rbenv/versions/1.9.3-p327/lib/ruby/1.9.1/fileutils.rb:1406:in `block in remove_file'

RBENV version
rbenv 0.4.0-49-g8b04303

Ruby version
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.4.0]

Running sudo pod install would work fine. What should I do to correct the permission error so that pod install can be run as normal?

StuartM
  • 6,743
  • 18
  • 84
  • 160

2 Answers2

21

Try

sudo chown -R `whoami` path/to/project/

if that doesn't help, you can also try

sudo chown -R `whoami` ~/.cocoapods
sudo chown -R `whoami` ~/Library/Caches/CocoaPods
Patrick Oscity
  • 53,604
  • 17
  • 144
  • 168
0

Unfortunately these steps didn't work for me and I resolve with:

sudo rm -fr ~/Library/Caches/CocoaPods/*
Luca Davanzo
  • 21,000
  • 15
  • 120
  • 146