gpt4 book ai didi

terminal - 安装 Google Cloud SDK 时未找到 gcloud 命令

转载 作者:行者123 更新时间:2023-12-02 13:16:57 24 4
gpt4 key购买 nike

我使用的是 Mac,并尝试在终端中使用此命令安装 Google Cloud SDK(包括 gcloud 命令行实用程序)

curl https://sdk.cloud.google.com | bash

https://cloud.google.com/sdk/所示

它一直到最后并完成,但即使在我重新启动 shell 后,gcloud 命令仍然说找不到它。

为什么此安装不起作用?

最佳答案

下面是我之前对这个问题的修复,但事实证明它不是永久性的。它可以工作,但每次重新启动终端时,您都必须执行相同的操作,这是不切实际的。

这就是为什么我建议您删除当前的 google-cloud-sdk 目录,然后重新安装。请务必(如 Zachary 所提到的)对提示回答“是 (Y)”修改配置文件以更新您的 $PATH 并启用 bash 补全? (是/否)

这是我的旧答案,但只需重做安装:

I had the same problem, gcloud wasn't working for me. But then, in the same directory as my google-cloud-sdk folder which I had just installed (my home directory), I found this file called test. Inside this test file I found two commands:

# The next line updates PATH for the Google Cloud SDK.
source '[path-to-my-home]/google-cloud-sdk/path.bash.inc'
# The next line enables bash completion for gcloud.
source '[path-to-my-home]/google-cloud-sdk/completion.bash.inc'

After I ran these two source commands in terminal, gcloud worked!

关于terminal - 安装 Google Cloud SDK 时未找到 gcloud 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31037279/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com