Cocoapods: Failed to run pod install after re-install cocoapods (Solution given beneath)

Created on 26 Sep 2017  Â·  7Comments  Â·  Source: CocoaPods/CocoaPods

Report

What did you do?

Run pod install --verbose

What did you expect to happen?

Install pods listed in Podfile

What happened instead?

Wrong Ruby interpreter

Failed to execute process '/usr/local/bin/pod'. Reason:
The file '/usr/local/bin/pod' specified the interpreter '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby', which is not an executable command.

CocoaPods Environment

Stack

   CocoaPods : 1.3.1
        Ruby : ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
    RubyGems : 2.6.13
        Host : Mac OS X 10.13 (17A365)
       Xcode : 9.0 (9A235)
         Git : git version 2.13.5 (Apple Git-94)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 90ed17438a72209b8df48120e94f072bfdd64812

Installation Source

Executable Path: /usr/bin/pod

Plugins

cocoapods-deintegrate : 1.0.1
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.2.0
cocoapods-try         : 1.1.0

Solution

After googled and I found this issue #6778 suggested to re-install cocoapods, I just followed up and the problem still occurred. But I find the path of newly-installed pod is different than before, the new one is located in /usr/bin/pod but previous is located in /usr/local/bin/pod, So I just deleted the previous one and run pod install --verbose again and it did worked! I'm not very familiar with Ruby, could anyone explain me? Thanks!

BTW, I've disabled SIP by csrutil disable.

Most helpful comment

I had the same problem. The problem was solved by reinstalling cocoapods:
sudo gem install cocoapods

All 7 comments

Keeping this closed. People can still search for it.

I had the same problem. The problem was solved by reinstalling cocoapods:
sudo gem install cocoapods

try this
just open terminal
1) sudo gem install cocoapods

After completion of install cocoa pods then
2) pod repo update

@JakubTudruj @satish1219 Just re-install didn't solve my problem and I've already figured out the solution posted in my origin comment. Thanks and keep this for others to search it : )

Thanks, reinstall worked for me

Had this issue after upgrading to macOS Catalina (trying to build a flutter app). Running sudo gem install cocoapods, and then flutter run worked.

Was this page helpful?
0 / 5 - 0 ratings