Mario J
Mario J

Reputation: 35

Cocoapods installation error mac terminal

While I try to run, in the terminal, the command: pod setup --verbose or pod install, the terminal returns me this error:

/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>'

How can I solve this?

Upvotes: 1

Views: 1700

Answers (2)

Gowtham
Gowtham

Reputation: 415

I found the same problem when i upgrade mac os version from 10.15 to 11.

Reason for that problem is, you need to update Xcode Command-line Tools.

I fixed that by using Below command in terminal

xcode-select --install

Upvotes: 4

Cristian Ortega
Cristian Ortega

Reputation: 61

That error means either you do not have Xcode command line tools installed or you recently changed/renamed Xcode location and old link is broken.

In order to fix it, you can run the following commands:

xcode-select --install
sudo xcode-select --switch /Applications/Xcode.app

You must replace /Applications/Xcode.app above with the path of your Xcode installation location. Please note you will be prompted to install Xcode command line tools.

Upvotes: 6

Related Questions