蜜蜂命令未找到

huangapple go评论75阅读模式
英文:

Bee command not found

问题

我刚开始学习golang和beego。昨天我安装了golang和bee。
我在命令行中遇到了很多问题,bee命令无法正常工作。但后来它突然可以工作了。

今天我想继续开发,但是又找不到bee命令了。
据我所知,这可能与PATH变量有关,但是一切似乎都没问题。

以下是你可能需要的不同信息来帮助解决问题。

Go已经安装并且可以正常工作。Go安装在:

/usr/local/go

我的go开发项目文件夹位于我的文档文件夹中:

/Users/Anders-air/Documents/go

在这个文件夹中,我有bin和src两个文件夹。src包含我的项目和包,而bin文件夹中有bee(Unix可执行文件)。

我的bash_profile文件内容如下:

export GOPATH=/Users/Anders-air/Documents/go
export PATH=$PATH:/Users/Anders-air/Documents/go/bin

希望有人能帮忙解决。顺便说一下,我使用的是OSX操作系统。

英文:

I just started learning golang and beego. Yesterday I installed golang and bee.
I had alot off trouble getting bee command in command line to work. At a point it started to work.

Today I wanted to continue development. But again it cant find bee command.
As far as I know its something with the PATH variable. But everything seems to be right.

Here comes the different informations you might need to help.

Go is installed and works. Go is installed in:

/usr/local/go

My project folder for go development is placed in my documents folder:

/Users/Anders-air/Documents/go

in this folder i have both bin and src. Src contains my project and packages. And inside bin you will find bee (Unix Executable File)

My bash_profile

export GOPATH=/Users/Anders-air/Documents/go
export PATH=$PATH:/Users/Anders-air/Documents/go/bin

Hopes someone can help. By the way I am use OSX.

答案1

得分: 4

你应该有一个名为GOBIN的路径变量,其路径是你的go根路径的bin目录。运行以下命令:

go install github.com/beego/bee

然后就可以使用bee命令了。

英文:

You should have a path variable named GOBIN, and its path is the bin of your go root path. Run:

go install github.com/beego/bee

then bee cmd can be used

答案2

得分: 4

vim .bashrc 插入

export GOROOT=/usr/local/Cellar/go/1.7.4/libexec
export GOPATH=$HOME/GoLang
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
英文:

vim .bashrc insert

export GOROOT=/usr/local/Cellar/go/1.7.4/libexec
export GOPATH=$HOME/GoLang
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin

答案3

得分: 1

这取决于你使用的是哪个shell。你需要将变量添加到终端的配置文件中。

在我的情况下,我使用的是zsh/zshrc。

尝试以下步骤:

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

nano ~/.zshrc

添加下面的行,并保存文件。

export GOPATH="$HOME/go"
export PATH="$GOPATH/bin:$PATH"

关闭并重新打开终端
现在,你应该能够运行bee version了。

英文:

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

答案4

得分: 0

似乎蜜蜂已被移除或未正确安装。重新运行获取命令后,一切都正常工作。

英文:

It seems like the bee has been removed or not installed the correct way.
After running the get command again everything works.

huangapple
  • 本文由 发表于 2015年8月9日 04:22:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/31898196.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定