首页 > 解决方案 > 为什么 gcloud components update 命令总是显示重启命令

问题描述

当我想将我的 Go 应用程序部署到 App Engine 时,我发现我必须安装 app-engine-go。它甚至说安装在一个新窗口上,没有弹出窗口。

https://github.com/ChihchengHsieh/ProblemsScreenShot/blob/master/image-2.png

C:\go-work\src\orderFunc>gcloud app deploy
The component [app-engine-go] is required for staging this
application.

Restarting command:
  $ gcloud components install app-engine-go

Installing component in a new window.

Please re-run this command when installation is complete.
    $ gcloud app deploy

当我运行命令gcloud components install app-engine-goandgcloud components update时,它显示:

https://github.com/ChihchengHsieh/ProblemsScreenShot/blob/master/image.png

C:\go-work\src\orderFunc>gcloud components install app-engine-go

Restarting command:
  $ gcloud components install app-engine-go


C:\go-work\src\orderFunc>gcloud components update

Restarting command:
  $ gcloud components update


C:\go-work\src\orderFunc>gcloud components install app-engine-go

Restarting command:
  $ gcloud components install app-engine-go

我已经尝试重新安装谷歌云 SDK,但它是一样的。

我希望它可以显示一些安装过程。

标签: google-app-enginegogoogle-cloud-platformgcloudgoogle-app-engine-go

解决方案


我试图为 .NET Google App Engine 应用程序部署快速入门,但遇到了同样的问题。我的问题是我需要执行$ gcloud components install beta才能部署我的 GAE .NET 应用程序。我得到了和你一样的行为。PowerShell 会打印

Restarting command:
  $ gcloud components install beta

但实际上什么也没发生。在我运行命令的同一窗口中没有弹出窗口或安装进度。用于安装或更新组件的其他命令也没有工作。我只能用 列出它们$ gcloud components list,但不能安装或更新它们中的任何一个。

解决方案

我注意到,如果您以管理权限运行 PowerShell,它将在C:\Windows\system32目录中打开一个窗口。如果您在那里执行命令,则会弹出另一个窗口并继续安装或更新 gcloud 组件。但是,如果您cd进入不同的目录,则行为将如本期所述。

所以要解决这个问题:

  1. 以管理员身份运行 PowerShell
  2. 如果目录与我上面描述的不同,则执行$ C:\Windows\system32否则转到步骤 3
  3. 对 gcloud 组件执行您想要的任何命令。例如$ gcloud components updategcloud components install beta等。
  4. 应弹出一个窗口并继续安装或更新组件。

推荐阅读