Installed Google Cloud SDK but can't access gcloud

47 views
Skip to first unread message

NicoM via StackOverflow

unread,
Jun 26, 2015, 10:18:07 PM6/26/15
to google-appengin...@googlegroups.com

I am trying to install the Google Cloud SDK on OSX and do this node.js tutorial (https://cloud.google.com/nodejs/getting-started/hello-world) and keep running into a problem where the gcloud is not found. It might be just be something simple about setting in or where I'm in saving the file.

I've read a ton of other posts here but haven't been able to solve this problem. Here are all the steps/issues:

I already created a project in the dev console.

Install the cloud sdk

MacBook-Pro-2:~ nico$ curl https://sdk.cloud.google.com | bash

Then go through the process

Directory to extract under (this will create a directory google-cloud-sdk) (/Users/nico):

Do you want to help improve the Google Cloud SDK (Y/n)?  y

Modify profile to update your $PATH and enable bash completion? (Y/n)? y

Enter path to an rc file to update, or leave blank to use [/Users/nico/.bash_profile]:

Then I tried to authenticate:

MacBook-Pro-2:~ nico$ gcloud auth login
-bash: gcloud: command not found

Then I went into a cloud sdk bin directory

MacBook-Pro-2:~ nico$ cd google-cloud-sdk/bin
MacBook-Pro-2:bin nico$ ./gcloud auth login

Authentication was successful

 MacBook-Pro-2:bin nico$ ./gcloud config set project helloworld-project

Setting the project was successful

MacBook-Pro-2:bin nico$ ./gcloud components update app

ERROR: (gcloud.components.update) Your current working directory is inside the Cloud SDK install root: /Users/nico/google-cloud-sdk.  
In order to perform this update, run the command from outside of this directory.

So then I move out of that directory

 MacBook-Pro-2:test_project nico$ gcloud components update app
-bash: gcloud: command not found

And now it's not working, do I have to set gcloud somewhere so it can be access globally? How can I update it and access the gcloud command line tool?



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/31084458/installed-google-cloud-sdk-but-cant-access-gcloud

Michael Aaron Safyan via StackOverflow

unread,
Jun 26, 2015, 10:28:04 PM6/26/15
to google-appengin...@googlegroups.com

Try creating a new shell; after updating your PATH, you may need to reload the shell before the update to the PATH variable takes effect. You can see if "gcloud" is defined using the command:

 which gcloud

If that doesn't work, then I'd recommend just updating your PATH manually. To do that, edit ~/.profile:

 nano ~/.profile

And then add the following line at the very end:

 export PATH="$HOME/google-cloud-sdk/bin:$PATH"

And restart your shell. Note that if you are using a shell other than the builtin Terminal, you may need to edit a different file (such as ~/.bashrc or ~/.bash_profile for a custom BASH installation, and various other "rc" files for altnerative shells such as ZSH, CSH, etc.) to update your PATH variable.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/31084458/installed-google-cloud-sdk-but-cant-access-gcloud/31084490#31084490
Reply all
Reply to author
Forward
0 new messages