So below is my previous fix for this problem, but it turns out it isn’t permanent. It works but every time you restart Terminal, you’d have to do the same thing which isn’t practical.
So that is why I suggest you delete the current google-cloud-sdk directory, and just redo the installation. Be sure (as Zachary has mentioned) to answer yes (Y) to the prompt Modify profile to update your $PATH and enable bash completion? (Y/n).
Here is my old answer, but just redo the installation:
I had the same problem,
gcloudwasn’t working for me. But then, in the same directory as mygoogle-cloud-sdkfolder which I had just installed (myhomedirectory), I found this file calledtest. Inside thistestfile 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
sourcecommands in terminal,gcloudworked!