I tried to update my pod in my project but receive the error shows below.
Update all pods
Analyzing dependencies
sh: line 1: 23831 Abort trap: 6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find git 2> /dev/null
git: error: unable to find utility "git", not a developer tool or in PATH
sh: line 1: 23834 Abort trap: 6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find git 2> /dev/null
git: error: unable to find utility "git", not a developer tool or in PATH
Creating shallow clone of spec repo `master-1` from `https://github.com/CocoaPods/Specs.git`
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master-1`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
How should I do about this?
I tried "which git" this morning, it shows
/usr/bin/git
It seems different with the dir shows above:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
It looks like your Xcode path is set up wrong, load up Xcode's preferences and ensure that the Command Line Tools option is set to what you want
The Command Line Tools option is correct(Xcode 6.3.2 (6D2105)), and this is the only option for me.
The issue is still open.
Any other suggestion?
Thanks any way @orta
You might also want to try sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
.
I have tried
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
but it didn't work neither.
I have spend all day on this issue without any progress.
=。=!!
Does /Applications/Xcode.app/Contents/Developer/usr/bin/git
exist for you? If not, I'd suspect a broken Xcode installation might be the problem.
Yes, it exists. You mean I should reinstall the xcode?
That could help, I am really unsure what else could be the cause of this not working.
Ok, I'll try and see if it works.
I'v tried to reinstall the xcode but the issue still remains.
Is there any possibility that I didn't configure my PATH correctly?
$pod repo add master https://gitcafe.com/akuandev/Specs.git
Cloning spec repo `master` from `https://gitcafe.com/akuandev/Specs.git`
[!] /usr/bin/git clone https://gitcafe.com/akuandev/Specs.git master
sh: line 1: 26763 Abort trap: 6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find git 2> /dev/null
git: error: unable to find utility "git", not a developer tool or in PATH
$ which git
/usr/bin/git
Is Xcode even installed in /Applications/
?
e.g.
$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
Sure, it located in /Applications/
it seems the issue of git.
$ git
sh: line 1: 27083 Abort trap: 6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find git 2> /dev/null
git: error: unable to find utility "git", not a developer tool or in PATH
I have the same problem... I couldn't execute commands from terminal using homebrew, git, etc. because of this error... Did you solve the problem MyEvonne?
Did you do some terrible operation?
I have the same problem, because I covered /bin/sh by a normal file. so, i copy /bin/sh to my computer from another computer, then this problem disappear.
@MyEvonne Hi, I have the same problem, can you give me some advice? thanks !:)
I'm subscribing. I have the same problem.
I got the same problem, but it seems that I have found out where the problem lies.
First, I have this problem, but the important thing is: I installed cocoapods using gem install cocoapods --user-install
after the required environment variables are exported.
But later on I reinstall cocoapods using sudo gem install cocoapods
, and everything is fine.
I don't know if there are any correlations between sudo
less install and this problem.
Hope my experience can help you guys a little bit on solving this issue.
Hi @lembacon I install RVM
fix my issue.
\curl -sSL https://get.rvm.io | bash
Maybe you can reference, hope to help you :)
http://stackoverflow.com/questions/21663876/cocoapods-install
https://rvm.io/rvm/install
@neonichu Thanks. Your answer is solved my problem.
Most helpful comment
It looks like your Xcode path is set up wrong, load up Xcode's preferences and ensure that the Command Line Tools option is set to what you want