2017年4月19日星期三

Installing macvim through Homebrew

Both are fairly common among the Mac community, so I'd assume this to be quite a legitimate scenario.

If the following is the path you go through:

1. Install Homebrew on a clean macOS with the one liner mentioned in https://brew.sh/;

2. The command line tools is installed along with Step 1;

3. Install macvim through brew (not the brew cask version);

4. An error occurs in Step 3 complaining about not able to compile without a full installation of Xcode;

5. Install Xcode through App Store;

6. Install macvim again.

Chances are that you will end up with an error like the following:

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

The root cause is pretty straightforward - besides having Xcode installed, you need to point your active developer directory to it. So what you've been missing here are:

1. Launch Xcode once, accept the license, then quit it (this is really tricky and easily neglected if you are not an Apple developer, so let's underline it);

2. Point your active developer directory to Xcode, either:
    sudo xcode-select --reset or if this doesn't help
    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer


By the way the active developer directory could be viewed with
    xcode-select --print-path

Or better yet, if you have read this note or similar readings before you even have your Homebrew installed, install Xcode first, which will (supposedly, haven't really tried) save you from the trouble of installing the command line tools.

没有评论:

发表评论