bee: command not found

根據beego官網資料,如下:

Windows 平臺下輸入:

>cd %GOPATH%/src
>bee new hello
>cd hello
>bee run hello

運行:bee new hello 的時候出現 bee:command not found 錯誤。

這時我們需要切換到 bee目錄,運行 go build 命令;如果運行成功會生成bee.exe 文件

當時沒這麼幸運 go build 運行失敗,並提示: cannot find package "github.com/smartystreets/goconvey/convey" in any of:

這時試着運行 go get github.com/smartystreets/goconvey 命令還是出錯:can't load package: package github.com/smartystreets/goconvey: no buildable Go source files in %GOPATH% \src\github.com\smartystreets\goconvey

直接在瀏覽器打開 github.com/smartystreets/goconvey 是有這個項目的,

解決方法:下載 github.com/smartystreets/goconvey 解壓並複製全部文件到 %GOPATH% \src\github.com\smartystreets\goconvey;運行 go get github.com/smartystreets/goconvey,此時再運行 go build 成功生成 bee.exe

注意:運行bee帶上完整地址  ./github.com/beego/bee/bee new hello

最後,運行:go run hello/main.go 項目成功運行此時可以打開歡迎頁面 http://127.0.0.1:8080/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章