Aks 1316
Aks 1316

Reputation: 382

Unable to install Beego framwork with GoLang on mac system

I am new in Go Lang and I am trying to install Beego framework on my mac system. But I am not sure how to install Beego and bee tools. I referred couple of sites but unable to find/resolve actual issue.

I am using below version of GO. go version go1.17.5 darwin/amd64

I am trying to install Beego from this website: https://beego.vip/ with command: go get github.com/beego/beego/[email protected]

After this it downloaded few files but I am not sure how to check if Beego is installed properly or not.

go env file

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/var/root/Library/Caches/go-build"
GOENV="/var/root/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/var/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/var/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.17.5/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.17.5/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17.5"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/usr/local/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2032782=/tmp/go-build -gno-record-gcc-switches -fno-common"

I have also installed. https://beego.vip/docs/install/bee.md

But when I am executing command like bee version I am getting error sh: bee: command not found

I also read that I need to set GOPATH and GOROOT values but not sure how to add those values.

export GOPATH=
export GOROOT=

Which values I need to set here?

Can you please guide me here?

Upvotes: 2

Views: 980

Answers (1)

Néstor Guerrero
Néstor Guerrero

Reputation: 31

It depends on which shell you are using. You have to add the variable to the configuration file of your terminal.

In my case, I'm using zsh/zshrc.

try this:

  • go install github.com/beego/bee/v2@latest

  • nano ~/.zshrc

  • Add the lines below, and save the file.

export GOPATH="$HOME/go"
export PATH="$GOPATH/bin:$PATH"
  • Close and re-open the terminal

Now, you should be able to run bee version

Upvotes: 2

Related Questions