【发布时间】:2019-07-11 18:57:15
【问题描述】:
我正在尝试在 Mac 上安装 Google Cloud SDK(遵循https://cloud.google.com/sdk/docs/quickstart-mac-os-x),使用install.sh 脚本:
~/Downloads$ ./google-cloud-sdk/install.sh
在记录的输出中,我看到以下说明:
==> Source [/Users/kurtpeek/Downloads/google-cloud-sdk/completion.bash.inc] in your profile to enable shell command completion for gcloud.
==> Source [/Users/kurtpeek/Downloads/google-cloud-sdk/path.bash.inc] in your profile to add the Google Cloud SDK command line tools to your $PATH.
确实,我发现使用gsutil 命令仍然会导致-bash: gsutil: command not found 错误,所以我仍然可能必须执行这一步。
但是,我并不完全清楚这些说明的含义。我在 Mac 上,我的 bash 个人资料是 ~/.bash_profile。为了使命令行完成工作,我必须添加哪些行?
更新
我第一次安装时没有使用sudo。使用sudo 重新安装时,我会收到一个额外提示,是否修改我的 bash 配置文件,在接受后会导致以下行添加到我的.bash_profile:
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/kurtpeek/Downloads/google-cloud-sdk/path.bash.inc' ]; then source '/Users/kurtpeek/Downloads/google-cloud-sdk/path.bash.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/kurtpeek/Downloads/google-cloud-sdk/completion.bash.inc' ]; then source '/Users/kurtpeek/Downloads/google-cloud-sdk/completion.bash.inc'; fi
但是,我仍然收到 gsutil: command not found 错误。
【问题讨论】:
-
你能告诉我们
which gsutil的输出吗? -
which gsutil没有输出... -
对于 Ubuntu (20.04 LTS),我找到了一个 few commands 解决了我的问题!
标签: bash shell google-cloud-platform