Rndomcoder
Rndomcoder

Reputation: 158

Unable to initialize gcloud environment

I have google cloud sdk installed on my ubuntu 14.4system but whenever I type gcloud init in my console, I get the following error:-

rbenv: gcloud: command not found

Further if I run gcloud init with sudo the error changes to:-

/usr/bin/env: ruby1.9.1: No such file or directory

I am unable to understand what has google cloud sdk to do with rbenv. I tried reinstalling google cloud sdk but with the same result. Is there a way out? any help is greatly appreciated.

Upvotes: 1

Views: 1145

Answers (2)

Scott Stensland
Scott Stensland

Reputation: 28335

On linux when you install the SDK it prompts to put following into your ~/.bashrc so PATH and such are setup to make cmds like gcloud visible

# The next line updates PATH for the Google Cloud SDK.
source '/home/scott/google-cloud-sdk/path.bash.inc'

# The next line enables shell command completion for gcloud.
source '/home/scott/google-cloud-sdk/completion.bash.inc'

If you are not on linux/OSX then the SDK install will have similar

Upvotes: 1

Zachary Newman
Zachary Newman

Reputation: 21404

It sounds as though gcloud is not on your $PATH.

If you installed the Cloud SDK to /home/username/google-cloud-sdk/, you should be able to invoke gcloud by running /home/username/google-cloud-sdk/bin/gcloud info. If you would like to be able to run simply gcloud, you can run export PATH="/home/username/google-cloud-sdk/bin:$PATH" (to make this setting persist, put that command in your ~/.profile file.

Upvotes: 0

Related Questions