Bill Lee
Bill Lee

Reputation: 65

Unable to setup Cocoapods, pod setup --verbose command failed

I'm trying to install cocoapods on my mac to use for iOS apps. So before finding a cocoapod tutorial, I may have tried to install a cocoapod for an xcode project with pod init and some other random things. I don't think pod init worked but another similar command did something

I then decided it would be a better idea to follow a tutorial from the beginning, so I started with installing cocoapods with the sudo gem install cocoapods, which worked.

However, when I typed pod setup --verbose, terminal threw an error which also happened when I typed pod setup

    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:118:in `git_version': Failed to extract git version from `git --version` ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun\n") (RuntimeError)
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:130:in `verify_minimum_git_version!'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:49:in `run'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
    from /usr/local/bin/pod:22:in `load'
    from /usr/local/bin/pod:22:in `<main>'

Please help, I can't find any answers on stackoverflow or any other website.

Upvotes: 3

Views: 4264

Answers (1)

adev
adev

Reputation: 2092

Based on the error message you are getting, it seems like you don't have command line tools installed. You need to install that and then go to Xcode -> Preferences -> Locations -> Command Line Tools and confirm you have current Xcode version selected there.

Xcode Command line tools

Upvotes: 38

Related Questions