Cocoapods: Errno::EACCES - Permission denied @ dir_s_mkdir

Created on 1 Aug 2018  路  6Comments  路  Source: CocoaPods/CocoaPods

Hi,

I have been trying for a while to install pods in my podfile, but seem to get the error above consistently. I have been using XCode 10 beta for a while, but have had no problems with this.

So far I have tried:

  • removing cocoapods completely from my project and reinitializing
  • uninstalling and reinstalling cocoapods from my mac
  • commenting out certain pods that seemed to be giving problems like GoogleMaps
  • running with sudo

I also checked out similar issues on github, but no luck with the suggestions there.

Here is the log from my terminal everytime I run pod install directly from my project folder:


Command

/Users/jacobokoenig/.rbenv/versions/2.3.1/bin/pod install

Report

  • What did you do?

  • What did you expect to happen?

  • What happened instead?

Stack

   CocoaPods : 1.5.3
        Ruby : ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
    RubyGems : 2.6.6
        Host : Mac OS X 10.13.6 (17G65)
       Xcode : 9.4.1 (9F2000)
         Git : git version 2.10.1
Ruby lib dir : /Users/jacobokoenig/.rbenv/versions/2.3.1/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 1259a6d4cb25ed7afbc1256d337fef0ab6798ff7

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Podfile

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Viumap' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Viumap

pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'Firebase/Messaging'
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'Hero', '~> 1.0'
pod 'PKHUD', '~> 5.0'
pod 'DZNEmptyDataSet'
pod 'Windless', '~> 0.1.5'
pod 'ViewAnimator'
pod 'Alamofire', '~> 4.7'
pod 'SwiftyJSON', '~> 4.0'
pod 'Stripe'
pod 'Kingfisher', '~> 4.0'
pod 'ParallaxHeader', '~> 2.0.0'
pod 'SkyFloatingLabelTextField', '~> 3.0'
pod 'Fabric', '~> 1.7.9'
pod 'Crashlytics', '~> 3.10.5'

#Remove if not using paypal
pod 'BraintreeDropIn'
pod 'Braintree/PayPal'
pod 'Braintree/Venmo'
pod 'Braintree/Apple-Pay'

  target 'ViumapTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'ViumapUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Error

Errno::EACCES - Permission denied @ dir_s_mkdir - /Users/jacobokoenig/Library/Caches/CocoaPods
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/2.3.0/fileutils.rb:253:in `mkdir'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/2.3.0/fileutils.rb:253:in `fu_mkdir'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/2.3.0/fileutils.rb:227:in `block (2 levels) in mkdir_p'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/2.3.0/fileutils.rb:225:in `reverse_each'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/2.3.0/fileutils.rb:225:in `block in mkdir_p'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/2.3.0/fileutils.rb:211:in `each'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/2.3.0/fileutils.rb:211:in `mkdir_p'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/2.3.0/pathname.rb:576:in `mkpath'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/config.rb:90:in `cache_root'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/downloader.rb:33:in `download'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/pod_source_installer.rb:121:in `download_source'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/pod_source_installer.rb:60:in `install!'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:374:in `install_source_of_pod'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:339:in `block (2 levels) in install_pod_sources'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:85:in `titled_section'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:338:in `block in install_pod_sources'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:321:in `each'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:321:in `install_pod_sources'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:164:in `block in download_dependencies'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:162:in `download_dependencies'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:117:in `install!'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command/install.rb:41:in `run'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run'
/Users/jacobokoenig/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
/Users/jacobokoenig/.rbenv/versions/2.3.1/bin/pod:22:in `load'
/Users/jacobokoenig/.rbenv/versions/2.3.1/bin/pod:22:in `<main>'

[!] Automatically assigning platform ios with version 11.0 on target Viumap because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.


Any ideas why this might be happening?

Most helpful comment

OK, apparently my issue was that the folder ~/Library/Caches/CocoaPods/ didn't exist for some reason. I created it manually and that fixed my problem.

Thanks for your help!

All 6 comments

This appears to be an issue that CocoaPods cannot create its cache folder in /Users/jacobokoenig/Library/Caches/CocoaPods.

Make sure you have sufficient permissions when you execute any pod command.

What I have tried doing is running pod install with 'sudo' but I get the following error: [!] You cannot run CocoaPods as root. How else would I be able to check that I have sufficient permissions?

ls -l /Users/dnkoutso/Library/Caches/CocoaPods/
total 0
drwxr-xr-x  6 dnkoutso  <redacted>  192 Jul 31 08:04 Pods

Read more here http://www.macinstruct.com/node/415

Use chmod to modify permissions.

OK, apparently my issue was that the folder ~/Library/Caches/CocoaPods/ didn't exist for some reason. I created it manually and that fixed my problem.

Thanks for your help!

sudo chown -R $USER <REACT PROJECT FOLDER>

will solve the issue for good!

sudo chown -R $USER /Users/$USER/Library/Caches/CocoaPods/

Was this page helpful?
0 / 5 - 0 ratings