Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

trouble installing Google Cloud SDK on OSX 10.9.1

Bit of a newbie here, im trying to install GC SDK following the guidelines here

https://developers.google.com/compute/docs/gcutil/

Do you want to update your system path to include the Google Cloud SDK
 (Y/n)?  y

Enter path to a file to append the PATH update to, or leave blank to 
use /Users/lawrencetaur/.bash_profile:  

Do you want to enable command-line completion? (Y/n)?  y

Traceback (most recent call last):
  File "/Users/lawrencetaur/google-cloud-sdk/bin/bootstrapping/install.py", line 293, in     <module>
    bin_path=bootstrapping.BIN_DIR,
  File "/Users/lawrencetaur/google-cloud-sdk/bin/bootstrapping/install.py", line 213, in     UpdatePath
    with open(rc_path, 'w') as rc_file:
IOError: [Errno 13] Permission denied: '/Users/lawrencetaur/.bash_profile'

All i want is to use it like a debian instance https://developers.google.com/compute/docs/quickstart#servewebpages

like image 465
Lawrence Taur Avatar asked Jan 20 '14 14:01

Lawrence Taur


2 Answers

I would like to add my own experience here just for reference. I'm using ZSH and iTerm2.

For me when installation prompted

"Enter path to an rc file to update, or leave blank to use: [/users/xxxx/.bash_profile]".

I typed in "~/.zshrc" because I was using ZSH.

the .zshrc file actually got modified but in a wrong way. The installation should add those to the rc file:

# The next line updates PATH for the Google Cloud SDK.
source '/Users/ianchz/~/users/ianchz/svn_repos/google-cloud-sdk/path.bash.inc'

# The next line enables bash completion for gcloud.
source '/Users/ianchz/~/users/ianchz/svn_repos/google-cloud-sdk/completion.bash.inc'

which should really be this if you are using zsh:

# The next line updates PATH for the Google Cloud SDK.
source '/Users/ianchz/~/users/ianchz/svn_repos/google-cloud-sdk/path.zsh.inc'

# The next line enables bash completion for gcloud.
source '/Users/ianchz/~/users/ianchz/svn_repos/google-cloud-sdk/completion.zsh.inc'

for some reason it's not replacing bash with zsh. I changed it in my ~/.zshrc and it worked. This way you won't lose autocompletion for gcloud command.

Hope this helps.

like image 189
Ian Zhao Avatar answered Oct 24 '22 07:10

Ian Zhao


The last line appears to indicate a permissions issue, preventing the setup from writing to your .bash_profile, you could try running the SDK installer with admin privileges, to do this run:

sudo curl https://dl.google.com/dl/cloudsdk/release/install_google_cloud_sdk.bash | bash

When it prompts you for a password, just enter your normal logon password.

Alternatively, if you are comfortable with editing your .bash_profile manually, when you are asked Do you want to update your system path to include the Google Cloud SDK? you could answer N, which will likely allow the setup to complete without error. You would then have to add the Cloud SDK tools to your system path manually. To do this edit the file using nano (or any other editor)

nano $HOME/.bash_profile 

Then at the bottom of the file add the line:

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

Then exit and save, by pressing Ctrl + X and then Y

You will then need to close your current terminal window and then open a new one for the tools to become available.

Note: If you get a permissions error, and are unable to save, you will need to Ctrl + X, then N to exit nano, then reopen, this time using elevated permissions:

sudo nano $HOME/.bash_profile 
like image 20
IanGSY Avatar answered Oct 24 '22 05:10

IanGSY