gcloud command not found -installing Google Cloud SDK

老子叫甜甜 提交于 2021-02-19 01:52:06

问题


I am trying to install the Google Cloud SDK on Mac using the following command in terminal

curl https://sdk.cloud.google.com | bash

It worked fine but when I move to the next step of

gcloud init

I get the following

-bash: gcloud: command not found

I have tried all solutions to the same question as in here, however I still get the same error message. The installer didn't prompt me with the following message either: Modify profile to update your $PATH and enable bash completion? (Y/n)?


回答1:


The root cause of this is the Cloud SDK not being added to your path. If you followed the multitude of other answers about this issue and still have the same problem, it means you missed a step.

You can edit /Users/<yourname>/.profile and either include the following lines:

# The next line updates PATH for the Google Cloud SDK.
source '<path-to-where-you-installed-the-cloud-sdk>/path.bash.inc'

Or you can manually set your PATH variable:

export $PATH=<path-to-where-you-installed-the-cloud-sdk>:$PATH



回答2:


I have the same trouble and put the sdk folder inside a folder with "-" in the path. So I clean the $PATH and change the folder's location to my home. and its work



来源:https://stackoverflow.com/questions/41188504/gcloud-command-not-found-installing-google-cloud-sdk

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