我是Google App Engine的新成員。而且,我遇到了一個我無法解決的問題。與引擎庫一起部署App引擎
我有一個非常簡單的應用程序(在轉到developped)是這樣的:
main/
| model/
| | user.go
| main.go
| app.yaml
這些main.go的進口:
import (
"github.com/julienschmidt/httprouter"
"log"
"net/http"
)
我的代碼工作得很好,當我運行本地。
但是,當我嘗試發佈它在我的谷歌應用程序引擎實例,我收到此錯誤:
$ 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
感謝您的回答。 它創建了我2個文件夾Godeps和供應商(其中包含我的依賴內容);但我仍然收到來自App Engine的相同錯誤: main.go:4:無法找到導入:「github.com/julienschmidt/httprouter」 – Belgikoi
您是否在app.yaml中包含了所有內容? –
嗨,我在編輯:)中添加了我的app.yaml的內容。 閱讀@Ain的回覆,似乎GoDeps無法幫助我。這是真的嗎? – Belgikoi