Problem installing Google Cloud SDK on OSX 10.9.1

A little newbie here, I'm trying to install the GC SDK according to the instructions 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 to do is use it as an instance of debian https://developers.google.com/compute/docs/quickstart#servewebpages

+8
installation google-compute-engine macos
source share
2 answers

The last line indicates the permission problem that does not allow the settings to be written to .bash_profile , you can try to run the SDK installer with administrator privileges to perform this run:

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

When you are prompted for a password, simply enter your normal password to enter.

Alternatively, if you are comfortable editing your .bash_profile manually when asked . Do you want to update your system path to enable the Google Cloud SDK? . can answer N , which is most likely to allow the installation to complete without errors. Then you will have to manually add the Cloud SDK tools to your system path. To do this, edit the file using nano (or any other editor)

 nano /Users/lawrencetaur/.bash_profile 

Then at the bottom of the file add the line:

 export PATH=/Users/lawrencetaur/google-cloud-sdk/bin:$PATH 

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

Then you need to close the current terminal window, and then open a new one so that the tools become available.

Note. . If you get a permission error and cannot save, you will need Ctrl + X , then N to exit nano and then reopen, this time using higher permissions:

 sudo nano /Users/lawrencetaur/.bash_profile 
+18
source share

I would like to add my own experience here for reference only. I use ZSH and iTerm2 .

For me when setting the request

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

I typed "~ / .zshrc" because I used ZSH .

The .zshrc file .zshrc actually been modified, but in the wrong way. The installation should add them 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 really should 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 does not replace bash with ZSH . I changed it in my ~/.zshrc and it worked. This way you won’t lose autocomplete for the gcloud team.

Hope this helps.

+29
source share

All Articles