Cocoa pod: No such file or directory

Gaurav Pandey picture Gaurav Pandey · Aug 30, 2016 · Viewed 7.3k times · Source

I have already a projects in which cocoapod was working fine previously but somehow now when I am trying to include new file. I am getting below error.

/Users/username/.podenv/libexec/../libexec/podenv-exec: line 31: /Users/username/.podenv/versions/1.0.1/bin/pod: No such file or directory

I was trying to delete MyProject.xcworkspace and Podfile so that I can reinstall Podfile but again getting above error.

Answer

chitnisprasanna picture chitnisprasanna · Aug 30, 2016

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