dpps0715 2019-01-30 17:46
浏览 155

beego二进制文件安装了荒谬的路径,“ bee new”命令不起作用

I installed almost 10 days ago golang in my Ubuntu 18.04.01 Server Edition:

go version
go version go1.10.4 linux/amd64

The GOPATH set in .bashrc is this:

export GOPATH=$HOME/go
export PATH=${PATH}:${GOPATH}/bin

and I've been using golang since then. Today I tried to install beego but happens something really strange:

go get -u github.com/astaxie/beego
go get -u github.com/beego/bee

The binary file is installed in a very long, and actually strange and absurd path:

marco@pc01:~/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:
/sbin:/bin:/usr/games:/usr/local/games:/snap/bin$ ls -lah
total 16M
drwxrwxr-x 2 marco marco 4.0K Jan 30 17:14 .
drwxrwxr-x 3 marco marco 4.0K Jan 30 17:14 ..
-rwxrwxr-x 1 marco marco  16M Jan 30 17:14 bee

While the src beego directory seems correctly installed:

/home/marco/go/src/github.com/beego/bee

What is strange, again, is that if try to execute this simple go code:

package main

import (
        "github.com/astaxie/beego"
)

type MainController struct {
        beego.Controller
}

func (this *MainController) Get() {

        this.Ctx.WriteString("hello world")

}

func main() {

        beego.Router("/", &MainController{})
        beego.Run()

}

go run helloBeego.go
2019/01/30 17:37:06.139 [I]  http server Running on http://:8080

And in the web browser I actually get:

hello world 

But when I try to create a bee project:

/go/src$ bee new my-first-beego-project

Command 'bee' not found, did you mean:

  command 'be' from deb bugs-everywhere
  command 'btee' from deb ruby-bcat
  command 'beef' from deb beef
  command 'bbe' from deb bbe
  command 'ben' from deb ben
  command 'beet' from deb beets
  command 'beep' from deb beep
  command 'see' from deb mime-support
  command 'ree' from deb ree
  command 'pee' from deb moreutils
  command 'beer' from deb gerstensaft
  command 'tee' from deb coreutils
  command 'bel' from deb belier

I guess that the absurd path in which bee binary is put and the fact that creation of bee project with 'bee new' command fails are related problems. How to solve them? Looking forward to your kind help. Marco

Added info, as rightly requested:

marco@pc01:~$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/marco/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/marco/go"
GORACE=""
GOROOT="/usr/lib/go-1.10"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.10/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-
map=/tmp/go-build461259545=/tmp/go-build -gno-record-gcc-switches"
marco@pc01:~$

Version of beego:

v1.6.2
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥35 平滑拟合曲线该如何生成
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集