簡體   English   中英

在OSX 10.9.1上安裝Google Cloud SDK時出現問題

[英]trouble installing Google Cloud SDK on OSX 10.9.1

這里有點新手,我試着按照這里的指導方針安裝GC SDK

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'

我想要的就是像debian實例一樣使用它https://developers.google.com/compute/docs/quickstart#servewebpages

我想在這里添加我自己的經驗僅供參考。 我正在使用ZSHiTerm2

安裝時提示我

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

我鍵入“〜/ ZSH ”,因為我使用的是ZSH

.zshrc文件實際上已被修改,但方式錯誤。 安裝應該將這些添加到rc文件:

# 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'

如果你使用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'

由於某種原因,它不是用zsh替換bash 我在~/.zshrc更改了它並且它有效。 這樣你就不會失去gcloud命令的自動完成gcloud

希望這可以幫助。

最后一行似乎表示權限問題,阻止設置寫入.bash_profile ,您可以嘗試運行具有管理員權限的SDK安裝程序,以執行此操作:

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

當它提示您輸入密碼時,只需輸入您的正常登錄密碼即可。

或者,如果您習慣手動編輯.bash_profile ,則在詢問您是否要更新系統路徑以包含Google Cloud SDK? 你可以回答N ,這可能會讓設置完成而不會出錯。 然后,您必須手動將Cloud SDK工具添加到系統路徑中。 為此,使用nano(或任何其他編輯器)編輯文件

nano $HOME/.bash_profile 

然后在文件的底部添加以下行:

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

然后按Ctrl + X然后按Y退出並保存

然后,您需要關閉當前的終端窗口,然后打開一個新的終端窗口以使工具可用。

注意:如果您收到權限錯誤,但無法保存,則需要按Ctrl + X ,然后按N退出nano,然后重新打開,這次使用提升的權限:

sudo nano $HOME/.bash_profile 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM