Invalid active developer path on MAC OS X after installing Ruby

烂漫一生 提交于 2019-11-27 07:10:20
Shuvo

I started getting the same error after updating to OS X El Capitan.
In my case, all I did was to install it:

sudo xcode-select --install

And it works fine for me.

[Update] The steps below are for OS X 10.10 (Yosemite). Those experiencing this because of an upgrade to 10.11 (El Capitan) seem need to only run sudo xcode-select --install as described in the accepted answer.

I found a suggestion here which indicated

sudo xcode-select -switch /

as the fix. However, this threw an error that the developer path was invalid.

Instead, for me, I modified this to

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/

(which is a mixture of the two referenced link solutions) and this worked.

[Edit]

Try using

xcode-select --print-path

to find your developer path if /Applications/Xcode.app/Contents/Developer/ is still invalid for you.

I know this is quite old but I got the same issue and then I fixed it by doing couple more extra steps. Problem came when Terminal could not find the actual path of the Command Line Tools.

  1. If you had Xcode and then removed it, then Terminal is referring to the Command Line Tools inside the Xcode folder. Try using this command and check what your path is, xcode-select --print-path. This would most likely print /Applications/Xcode.app/Contents/Developer.
  2. Now to fix this, reinstall the command line tools for xcode. Initially remove any previous installations using sudo rm -rf /Library/Developer/CommandLineTools.
  3. Then install the command line tools sudo xcode-select --install Now the final step, change the path for the CLT to the actual path using sudo xcode-select -switch /Library/Developer/CommandLineTools/ this will fix it.
Joe

For me the solution was as easy as reinstalling Xcode.

It was pointed out here: https://superuser.com/a/981126

You can (re)install Xcode via command line like the answer above suggest, or directly from the App Store.

suresh

I too had the same issue after upgrading to OS X EI Captian. I just installed xcode-select using sudo xcode-select --install

I resolved the issue with the below steps.

Xcode -> Preferences -> Locations -> Command Line Tools -> Select the command tool matching your Xcode version.

I had faced the same issue when i removed one of the two Xcode installed.

I have solve this issue by Switching the path using terminal like below

$ sudo xcode-select --switch (drag Xcode here to get a path)

e.g sudo xcode-select --switch /Applications/Xcode\ 10.1.app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!