Reputation: 267
I'm trying to install cocoapods and it always fail at 'Setting up CocoaPods master repo' with below error code:
[!] /usr/bin/git clone 'https://github.com/CocoaPods/Specs.git' master --depth=1
sh: line 1: 8018 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've tried all the suggestions on StackOverFlow like uninstall and re-install cocoapods or rm -fr ~/.cocoapods/repos/master but it still fail. I'm using xCode 6.1.1 with the newest Command Line Tool on Yosemite 10.10
Upvotes: 1
Views: 4576
Reputation: 267
After a few days going crazy with it. I found a workaround to resolve this problem. It's a workaround because I don't know the root cause and I have to repeat these steps every time I want to do command relates with cocoapods.
Seems like the PATH variable for cocoapods has been changed in Yosemite 10.10, so you need to fix the PATH for cocoapods to understand it.
First, I have to use this command:
sudo rm -fr ~/.cocoapods/repos/master
Then this:
pod setup
And this:
export PATH="/usr/local/git/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:$PATH"
After that, I could use 'pod setup', 'pod install', 'pod search',... normally as I did before.
Does anybody know how to completely resolve this problem? Because everytime I want to update the pods, I have to repeat those steps above
Upvotes: 1