cocoaPods pod install Permission denied

后端 未结 10 1298
时光说笑
时光说笑 2020-12-02 07:49

This is the short version:

When I run

pod install 

in an Xcode project I get

[!] Pod::Executable pull erro

10条回答
  •  情话喂你
    2020-12-02 08:23

    With all the errors that I got while installing CocoaPods in some of my projects, I've finally succeeded in finding a pattern with it. Here it is:

    1. Access your project folder from the terminal:

      $ cd /Users/username/Downloads/MessagesTableViewController-master
      
    2. Create a podfile:

      $ touch podfile
      $ open -e podfile
      
    3. After the podfile is created, access it via the Finder and edit it in any other text editor except TextEdit because TextEdit sometimes messes up with apostrophes in the pod file. I used textWrangler. Write the following in the pod file; (Note these dependencies are for projects that support iOS version 6.0 and above)

      platform :ios, '6.0'
      pod 'AFNetworking'
      
    4. Save the file and close it.

    5. Go back to the terminal and see your pod version:

      $ pod --version
      

      Depending on your pod version, if an update is required, run this command:

      $ sudo gem update
      
    6. After the update completes, or it states that it is already up-to-date, you should install the cocoapods:

      $ sudo gem install cocoapods
      
    7. And at the very end, just run the following commands:

      $ sudo pod setup
      $ sudo pod install
      

    And Viola! It is done. You'll see a Pods named folder within your project folder and the dependency you stated in the pod file will be apparent in Pods folder as a sub-folder.

    Happy coding :)

提交回复
热议问题