2014-01-18 22 views

回答

3

產生此錯誤消息中goapp/serve.go(「unable to find dev_appserver.py」)示出了下面的代碼:

if p := os.Getenv("APPENGINE_DEV_APPSERVER"); p != "" { 
    return p, nil 
} 
return "", fmt.Errorf("unable to find dev_appserver.py") 

所以仔細檢查是否使用goapp時,APPENGINE_DEV_APPSERVER環境變量實際設置。
例如見這個gotool.bat腳本確實組變量
(但dsymonds正確points out,你不應該直接設置它,你應該總是使用goapp):

@echo off 
:: Copyright 2012 Google Inc. All rights reserved. 
:: Use of this source code is governed by the Apache 2.0 
:: license that can be found in the LICENSE file. 
setlocal 
set GOROOT=%~dp0\goroot 
set APPENGINE_DEV_APPSERVER=%~dp0\dev_appserver.py 
set GOARCH= 
set GOBIN= 
set GOOS= 

:: Set a GOPATH if one is not set. 
if not "%GOPATH%"=="" goto havepath 
set GOPATH=%~dp0\gopath 
:havepath 

%GOROOT%\bin\%~n0.exe %* 
+0

Damit爲什麼不能他們將它包含在錯誤消息中:)「APPENGINE_DEV_APPSERVER env設置不正確」 –

+1

請勿設置APPENGINE_DEV_APPSERVER。使用SDK頂部的goapp,而不是埋在goroot/bin下的那個。 – dsymonds

+0

@dsymonds你是對的。我並不想讓用戶自己設置「APPENGINE_DEV_APPSERVER」,只是爲了檢查它是否已設置。我已經修改了答案,並且包含了您的評論。 – VonC

相關問題