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/

<div class="post-text" itemprop="text"> <p>I am trying to run a project that uses beego framework. When I try to run the project I encounter the following problem every time.</p> <pre><code>No command 'bee' found, did you mean: Command 'bel' from package 'belier' (universe) Command 'bbe' from package 'bbe' (universe) Command 'pee' from package 'moreutils' (universe) Command 'beep' from package 'beep' (universe) Command 'ree' from package 'ree' (universe) Command 'beet' from package 'beets' (universe) Command 'ben' from package 'ben' (universe) Command 'beer' from package 'gerstensaft' (universe) Command 'be' from package 'bugs-everywhere' (universe) Command 'see' from package 'mime-support' (main) Command 'tee' from package 'coreutils' (main) Command 'btee' from package 'ruby-bcat' (universe) Command 'beef' from package 'beef' (universe) bee: command not found </code></pre> <p>My Go Environment : ($ go env)</p> <pre><code>GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/MYNAME/go" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build235821315=/tmp/go-build -gno-record-gcc-switches" CXX="g++" CGO_ENABLED="1" PKG_CONFIG="pkg-config" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" </code></pre> <p>My Environment declerations in bash_profile : </p> <pre><code>PATH="$HOME/bin:$HOME/.local/bin:$PATH" export GOPATH=$HOME/work export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin export PATH="$GOPATH/bin:$PATH"' </code></pre> <p>Where am i doing wrong? What should i do?</p> </div>
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页