trouble installing Google Cloud SDK on OSX 10.9.1

后端 未结 2 997
名媛妹妹
名媛妹妹 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:01

    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 
    
    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题