Las herramientas de línea de comandos no funcionan-OS X El Capitan / macOS Sierra / macOS High Sierra


Acabo de actualizar de Yosemite a El Capitan (y replicé el problema de actualizar de El Capitan a Sierra), y cuando intento escribir por ejemplo git status dentro de un terminal, obtengo el siguiente error:

xcrun: error: invalid active developer path
 (/Library/Developer/CommandLineTools), missing xcrun at:
 /Library/Developer/CommandLineTools/usr/bin/xcrun

No tengo Xcode instalado, nunca lo hice. Alguien tiene una solución?

Author: rista404, 2015-10-01

11 answers

Encontró la solución para el problema aquí.

xcode-select --install

Esto abrirá un mensaje para instalar las herramientas de línea de comandos necesarias.

 1040
Author: cuadraman,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-03-25 15:22:29

Si tiene problemas con el comando xcode-select --install; por ejemplo, sigo recibiendo un tiempo de espera de problema de red, intente descargar el dmg en developer.apple.com/downloads (Herramientas de línea de comandos OS X 10.11) para Xcode 7.1

 76
Author: Ryan Heitner,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-04-17 15:06:57

Probé la solución xcode-select --install pero no me ayuda, actualizo de Sierra a Alta y sucedió esto, mi solución:

sudo xcode-select --reset
 4
Author: Cristofer Fuentes,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-10-11 01:44:22

Reasignar la ruta Xcode está configurado con worked for me.

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

Entonces es probable que se le solicite (después de probar un comando) que acepte el acuerdo de licencia.

 3
Author: tristen,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-20 14:14:01

Actualizado a High Sierra 10.13.2

Xcode-select install install POR sí solo no funcionó para mí.

  1. Descarga X-code desde app store
  2. $xcode-select install install
    a. Puede necesitar actualizar después de la instalación usando softwareupdate en la línea de comandos. Tools sudo softwareupdate-i "Herramientas de línea de comandos (macOS High Sierra versión 10.13) para Xcode-9.1"

  3. $sudo xcodebuild-license

 2
Author: Viktor Nikitenko,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-12-08 18:02:16

Acabo de actualizar a High Sierra y no podía simplemente ejecutar xcode-select --install. Primero, tuve que instalar xcode desde la app store. Entonces corrí xcode-select --install. Luego tuve que ejecutar sudo xcodebuild -license, aceptar los términos, y finalmente pude ejecutar nuevamente los comandos de git.

 1
Author: ProGrammar,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-13 22:40:10

Para aquellos que también tienen problemas con heroku herramientas de línea de comandos después de actualizar, también tuve que hacer lo siguiente en mi terminal:

xcode-select --install 
brew install heroku/brew/heroku
brew link --overwrite heroku

Parece que la actualización a High Sierra se metió con mis enlaces simbólicos además de obligarme a reinstalar las herramientas de xcode. Seguí recibiendo errores de 'no es un directorio':

▸ stat /Users/mattymc/.local/share/heroku/client/bin/heroku: not a directory  
▸ fork/exec /Users/mattmcinnis/.local/share/heroku/client/bin/heroku: not a directory 

Esperanza que salva a alguien una hora:)

 1
Author: Matt,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-28 15:32:27

Después de la actualización a macOS 10.13.3

Después de actualizar do macOS 10.13, tuve que instalar "Herramientas de línea de comandos (macOS 10.13) para Xcode 9.3" descargado desde https://developer.apple.com/download/more /

 1
Author: Oleksii Kyslytsyn,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-02-25 15:03:10

Actualizé mac os a macOS High Sierra - 10.13.3 y me enfrenté a un problema similar al intentar instalar watchman (con el comando - brew install watchman).

Ejecutó el comando: xcode-select install install, luego ejecutó "brew install watchman" - ¡Todo funciona bien!

 1
Author: Shiyas Cholamukhath,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-03-06 06:35:33

Para mí, después de haber eliminado Xcode, tengo que cambiar la ruta del desarrollador activo de la siguiente manera: sudo xcode-select -s /

 1
Author: Son Nguyen,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-04-23 10:47:24

Lo resolví con una reinstalación de cocoapods

sudo gem install cocoapods
 -3
Author: Karsten,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-13 12:53:26