问题描述:

This question already has an answer here:

  • Cocoapods commands fail due to “No such file or directory @ dir_initialize - /Users/<username>/.cocoapods/repos (Errno::ENOENT)”

    11 answers

网友答案:

My guess is that you somehow deleted the cocoapods itself rather then project and Podfile of specific project, kindly re install the cocoapods by following below commands:

  1. Open Terminal.
  2. Enter command:

    $ sudo gem install cocoapods
    
  3. Create new Xcode project.

  4. Navigate to directory containing Xcode project. Use:

     cd ../directory-location/.. 
    

    or cd [drag-and-drop project folder]

  5. Enter command to create the Podfile:

    $ pod init
    
  6. Enter command

    $ pod install
    
相关阅读:
Top