我正在尝试安装gcloud,同时使用coporate网络,它可以在代理(有时甚至是VPN )后面工作。我使用pac.fcgi文件自动获得代理设置(自动代理配置)。
现在,当我试图在终端中运行./install.sh时,我经常会收到以下错误
➜ google-cloud-sdk ./install.sh
Welcome to the Google Cloud SDK!
To help improve the quality of this product, we collect anonymized usage data
and anonymized stacktraces when crashes are encountered; additional information
is available at <https://cloud.google.com/sdk/usage-statistics>. You may choose
to opt out of this collection now (by choosing 'N' at the below prompt), or at
any time in the future by running the following command:
gcloud config set disable_usage_reporting true
Do you want to help improve the Google Cloud SDK (Y/n)?
ERROR: (gcloud.components.list) Failed to fetch component listing from server. Check your network settings and try again.我发现这个问题也有同样的问题,但它们的问题与ipv6有关。我已经禁用了ipv6 (我甚至不能启用它),我正在使用以太网连接到网络。因此,这个答案对我是没有用的。
我搜索了有关安装的代理相关信息,并找到了此页。它要求使用非交互式安装程序,并在安装后使用gcloud命令设置代理。我的问题是我甚至不能安装gcloud。我已经尝试了互动和非交互式安装程序。
我可以在公司代理背后安装gcloud的任何方式。
PS:我在macOS High上,使用zsh (已经尝试过bash),以防有问题。
发布于 2018-10-05 06:43:24
因此,问题是我无法在安装gcloud之前设置代理。gcloud的安装基本上设置了路径中的CLI,并安装了一些必需的组件(core、bq、gsutil等)。
所以我所做的就是在我的.zshrc中添加了以下几行
source <PATH to gcloud sdk>/google-cloud-sdk/path.zsh.inc
source <PATH to gcloud sdk>/google-cloud-sdk/completion.zsh.inc或者,如果使用bash,则在.bashrc或.bash_profile中添加以下行
source <PATH to gcloud sdk>/google-cloud-sdk/path.bash.inc
source <PATH to gcloud sdk>/google-cloud-sdk/completion.bash.inc之后,我重新启动了终端(或者只是在终端上运行source ~/.zshrc、source ~/.bashrc或source ~/.bash_profile )。
现在我能够使用gcloud命令了。我运行gcloud init,设置代理,然后使用以下命令安装所需的组件-
gcloud components install core bq gsutil我不使用gcloud脚本就安装了install.sh。
PS:运行scutil --proxy以了解系统中设置的代理设置。
发布于 2020-01-10 06:03:41
对于体验此问题的Windows 10用户。我从存档版本页面安装了google。然后使用git使用./google-cloud-sdk/install.sh进行安装。然后将环境变量手动添加到PATH以使用命令。
https://stackoverflow.com/questions/52645927
复制相似问题