Today, a friend asked me a question: Why I installed cocoapods unsuccessful, reported
Sh:line 1:997 Abort trap:6/applications/xcode.app/contents/developer/usr/bin/xcodebuild-sdk/-find git 2>/dev/nu ll
Git:error:unable to find utility ' git ', not ' a developer tool or in PATH
To report such errors. At that time, I asked him if he was installing the installation steps of the official website. He said yes.
At that time, I was very puzzled, because I installed the time is so step by step, no problem ah. Then I saw this error "unable to find utility" Git ", not a developer tool or in PATH",
The GIT path could not be found. Then, in order to verify that he entered "git" in the terminal, the result is true. And then "which git" = = =
/usr/bin/git
This time indicates that the system has git. Then why not path. (originally in order to understand PHP, on the machine also configured similar things, but also do not understand the inside of things, to tell the truth command this thing a little let me not adapt). So how is this problem solved:
1. Vim ~/.bash_profile
2. Under the file I input export path= "/usr/local/git/bin: $PATH", Save: Wq
3. Update the source ~/.bash_profile
4. Git
======================= over
But during this time, I was offered other solutions with the. bashrc file. What is the difference between these two documents, or what is the earth?
Mac generally uses bash as the default Shell,mac the default environment variables are loaded in the order:
/etc/profile/etc/paths ~/.bash_profile ~/.bash_login ~/.profile ~/.BASHRC
Where/etc/profile and/etc/paths are system-level
So there are more than 2 solutions to this problem.
This is an example of modifying the cocoapods specs Image:
Pod Repo Remove Master
Pod Repo Add Master Https://gitcafe.com/lloydsheng/Specs.git
Pod Repo update
But what does his terminal not directly git, and what can I do? I don't have a problem with this question, which is said to be the 10.10 system.
==================other knowledge
Learn another thing between here, don't understand these things before, and share another knowledge of Mac: the Ultimate shell
Some problems with installing Cocoapods under Mac OS10.10