【发布时间】:2017-05-27 22:11:03
【问题描述】:
我是 Google App Engine 的新手。而且,我遇到了一个我无法解决的问题。
我有一个非常简单的应用程序(使用 Go 开发),如下所示:
main/
| model/
| | user.go
| main.go
| app.yaml
这些是 main.go 的导入:
import (
"github.com/julienschmidt/httprouter"
"log"
"net/http"
)
我的代码在本地运行时运行良好。
但是,当我尝试在我的 Google App Engine 实例上发布它时,我收到了这个错误:
$ gcloud app deploy
You are about to deploy the following services:
- <MY_APP_ENGINE_URL> (from [<MY_LOCAL_YAML_PATH>])
Deploying to URL: [<MY_APP_ENGINE_URL>]
Do you want to continue (Y/n)? Y
Beginning deployment of service [default]...
Some files were skipped. Pass `--verbosity=info` to see which ones.
You may also view the gcloud log file, found at
[<LOCAL_APP_ENGINE_LOG>].
File upload done.
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Deployment contains files that cannot be compiled: Compile failed:
2017/05/27 14:48:24 go-app-builder: build timing: 5×compile (301ms total), 0×link (0s total)
2017/05/27 14:48:24 go-app-builder: failed running compile: exit status 2
main.go:4: can't find import: "github.com/julienschmidt/httprouter"
我做错了什么?
编辑: 这是我的 app.yaml 文件的内容:
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
【问题讨论】:
标签: google-app-engine go gcloud