trouble installing Google Cloud SDK on OSX 10.9.1

后端 未结 2 996
名媛妹妹
名媛妹妹 2021-02-06 00:24

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          


        
2条回答
  •  星月不相逢
    2021-02-06 01:20

    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.

提交回复
热议问题