Build process failure - RuntimeError: command line tools failure


Hello all,

I am new to installing MRtrix3 and I followed the instructions on this page here ( I used homebrew to install everything (running 10.11 El Capitan) . However, I’m getting the below error. I cannot figure out a way past this as I have Xcode installed (also tried it with xcode command lines tools installed but got the same error) so I’m not sure why it’s failing. Any ideas to resolve this error would be greatly appreciated.

NT-MBP:~ NT$ brew instal mrtrix3

==> **Installing mrtrix3 from mrtrix3/mrtrix3**

==> **Cloning**

Updating /Users/NT/Library/Caches/Homebrew/mrtrix3--git

==> **Checking out branch master**

Already on 'master'

Your branch is up to date with 'origin/master'.

HEAD is now at d2cd716 Merge pull request #1451 from MRtrix3/amp2response_speedup_bugfix_to_master

Entering 'testing/data'




xcodebuild failed with the error message:

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

If the command line tools were installed before Xcode, you can fix this with:

sudo xcode-select -s /Applications/

/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `write': Broken pipe (Errno::EPIPE)

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `puts'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `rescue in block (3 levels) in safe_fork'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:31:in `block (3 levels) in safe_fork'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in `fork'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in `block (2 levels) in safe_fork'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in `open'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in `block in safe_fork'

from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir'

from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:26:in `safe_fork'

from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:719:in `build'

from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:311:in `install'

from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:321:in `install_formula'

from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:253:in `block in install'

from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:251:in `each'

from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:251:in `install'

from /usr/local/Homebrew/Library/Homebrew/brew.rb:89:in `<main>'

Error: An exception occured within a build process:

RuntimeError: command line tools failure


The problem (and potential solution) seems to be embedded in your error log:

Have you tried running the command suggested here?


Yes, thank you. The embedded command worked. I also ran sudo xcodebuild -license accept along with the above mentioned command and was able to install it successfully.