comando gcloud no encontrado - durante la instalación de Google Cloud SDK
Estoy en un mac y estoy tratando de instalar el SDK de Google Cloud (incluida la utilidad de línea de comandos gcloud) usando este comando en terminal
curl https://sdk.cloud.google.com | bash
Como se ve en https://cloud.google.com/sdk/
Llegó hasta el final y terminó, pero incluso después de reiniciar mi shell, el comando gcloud
todavía dice que no se encuentra.
¿Por qué no funciona esta instalación?
18 answers
Así que a continuación está mi corrección anterior para este problema, pero resulta que no es permanente. Funciona, pero cada vez que reinicies Terminal, tendrías que hacer lo mismo, lo cual no es práctico.
Así que es por eso que sugiero que elimine el directorio actual de google-cloud-sdk, y simplemente rehaga la instalación. Asegúrese (como Zachary ha mencionado) de responder sí (Y) al prompt Modify profile to update your $PATH and enable bash completion? (Y/n)
.
Aquí está mi vieja respuesta, pero simplemente rehaga la instalación:
I had the same problem, `gcloud` wasn't working for me.
But then, in the same directory as my `google-cloud-sdk` folder which I had just installed (my `home` directory), I found this file called `test`.
Inside this `test` file I found two commands:
# The next line updates PATH for the Google Cloud SDK.
source '[path-to-my-home]/google-cloud-sdk/path.bash.inc'
# The next line enables bash completion for gcloud.
source '[path-to-my-home]/google-cloud-sdk/completion.bash.inc'
After I ran these two `source` commands in terminal, `gcloud` worked!
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
2015-06-25 19:16:31
Lo mismo aquí, intento
source ~/.bashrc
Entonces, funcionó
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
2015-09-09 09:01:32
En Mac / Linux, deberá ingresar la siguiente entrada en su ~/.bashrc
:
export PATH="/usr/lib/google-cloud-sdk/bin:$PATH"
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-09-09 19:46:14
Este funcionó para mí:
source ~/.bash_profile
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-10-16 17:29:50
Tuve este problema hoy, y añadiendo sudo
a la install command
solucionado mi problema en maxOS Sierra!
sudo ./google-cloud-sdk/install.sh
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-01 23:20:53
Sé que esta pregunta ha sido respondida, pero aquí están mis dos centavos. Después de instalar gcloud, debe reiniciar el shell antes de poder ejecutar el comando gcloud.
Cómo hacer esto, depende principalmente del archivo que mantenga su configuración de shell. La mayoría de los archivos son .bashrc_profile
, .bashrc
, .zshrc
.
Ahora puede reiniciar con
source ~/.bashrc_profile
Puede reemplazar el archivo por el archivo que tiene.
O si no le importa el archivo que tiene, en Mac o Linux puede reiniciar el shell .
exec -l $SHELL
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-15 12:08:59
Al instalar el SDK usé este método:
curl https://sdk.cloud.google.com | bash
Al usar este método del autor original, asegúrese de haber aceptado las preferencias de seguridad en la configuración de Mac para permitir que las aplicaciones descargadas de la tienda de aplicaciones y los desarrolladores identificados.
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-18 22:45:43
Tuve que buscar el código fuente de mi archivo bash_profile. Para ello,
- Abre una sesión de Terminal.
- En ese tipo de sesión: fuente .bash_profile y luego presione enter
Ahora, el comando gcloud debería funcionar
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
2015-09-05 18:17:10
Esto funcionó para mí :
Después de decir Y
a Modify profile to update your $PATH and enable bash completion? (Y/n)?
Google initiation está solicitando esto : Enter a path to an rc file to update, or leave blank to use
y la ruta predeterminada era : [/Users/MY_USERSAME/.bash_profile]:
pero en lugar de presionar enter
, escribí : /Users/MY_USERNAME/.bashrc
para cambiar la ruta.
Esto sobrescribiría la ubicación predeterminada que Google sugiere.
Entonces, solo tenía que hacer source ~/.bashrc
y todo funciona ahora!
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-10-28 16:35:32
Estoy ejecutando zsh y encontré esto muy útil: https://gist.github.com/dwchiang/10849350
Edita el ~/.zshrc archivo para incluir estas dos líneas:
# The next line updates PATH for the Google Cloud SDK.
source /Users/YOUR_USERNAME/google-cloud-sdk/path.zsh.inc
# The next line enables zsh completion for gcloud.
source /Users/YOUR_USERNAME/google-cloud-sdk/completion.zsh.inc
Esto supone que ha instalado el paquete en su directorio principal desde los documentos oficiales
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-04 23:44:22
Solo tienes que ejecutar este comando como root
$ curl https://sdk.cloud.google.com | bash
Reinicie el terminal y listo. Ahora todos los comandos deben ser ejecutados como root
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-09 17:12:47
Encontré if-fi
declaraciones incorrectas en mi ~/.bash_profile
(no condición if en el siguiente bloque)
source '/Users/yorko/google-cloud-sdk/path.bash.inc'
fi
Solo tuve que eliminar "fi"
y ejecutar "source ~/.bash_profile"
para que funcionara.
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-10-02 18:36:57
Si se ejecuta
source ~/.bashrc
Resulta en"No hay tal archivo o directorio"
En windows:
- Vaya a c/Users/
- Mientras mantiene presionada la tecla mayús, haga clic con el botón derecho .bashrc y seleccione "Copiar como ruta"
- En bash:
source <pasteCopiedPathHere>
- > por ejemplo:source "C:\Users\John\.bashhrc"
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-05-04 15:12:44
Tuve el mismo problema y fue porque el ~/.bash_profile
tenía sentencias fi
inválidas.
La solución:
- Ejecutar comando
sudo nano ~/.bash_profile
- Eliminadas las declaraciones de cierre
fi
(las que faltan una aperturaif
) - Guardar .bash_profile changes
- Ejecutar comando
source ~/.bash_profile
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-10-05 17:50:30
$ sudo su
$ /opt/google-appengine-sdk/bin/gcloud components update
$ su <yourusername>
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-10-08 14:53:59
Las instrucciones posteriores a la instalación no son claras:
==> Source [/.../google-cloud-sdk/completion.bash.inc] in your profile to enable shell command completion for gcloud.
==> Source [/.../google-cloud-sdk/path.bash.inc] in your profile to add the Google Cloud SDK command line tools to your $PATH.
Tuve que agregar las siguientes líneas de código en mi .bash_profile
para que gcloud
funcionara:
source '/.../google-cloud-sdk/completion.bash.inc'
source '/.../google-cloud-sdk/path.bash.inc'
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-01 14:21:14
Ahora después de ejecutar install.sh
en Mac OS
, Google mismo da la información para ejecutar completion.bash.inc
y path.bash.inc
.
Si está utilizando zsh
terminal, le pedirá que ejecute completion.zsh.inc
y path.zsh.inc
. Por favor, vea la imagen de abajo
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-07 00:37:38
Cómo instalar GCloud y Siempre Funciona después del Reinicio En Mac OS HIGH Sierra:
Descargar paquete de instalación Aquí
-
Logrado archivo y soltar en su carpeta
- Abra terminal, vaya a su carpeta con archivo e ingrese este comando: . /google-cloud-sdk/install.sh
- " ¿Modificar el perfil para actualizar su PATH PATH y habilitar la finalización de bash?" Sí
- Introduzca esta ruta para modificar: "/Users / USERNAME_COMPUTER/.bashrc "
- Después de todo instalar, introduzca esto: "fuente ~/.bashrc "
- Introduzca esto para comprobar instalar gcloud: "gcloud - -version"
- Abra una nueva ventana terminal 'cmd+n' NO CIERRE LA VENTANA ANTIGUA e ingrese en la nueva ventana'gcloud version' si: "comando no encontrado", vaya al paso 9 de lo contrario: Felicitaciones GCloud trabajo en terminal
- Vuelva a la ventana anterior e introduzca 'echo PATH PATH' y copiar ruta a GCloud
- Abrir BASH_PROFILE: abrir ~/.bash_profile
- Introduzca la ruta a la nueva Bash: " exportación PATH= "/ Users/USERNAME_COMPUTER/google-cloud-sdk / bin: PATH PATH" "
- Volver al paso 8
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-09-21 07:04:35