“exec: ‘sqlboiler’: 在 $PATH 中找不到可执行文件。”

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

exec: "sqlboiler": executable file not found in $PATH

问题

安装了SqlBoiler之后。

在main.go中复制并粘贴简单的代码,然后执行postgresql以创建数据库。

我通过以下方式生成了Go模型:

go generate

我遇到了一个错误:

运行"sqlboiler"时:exec: "sqlboiler": 在$PATH中找不到可执行文件

我看了SQLBoiler Screencast,但它假设用户预先配置了Sql Boiler。

我漏掉了什么?

英文:

After installed SqlBoiler.

Copy and paste simple codes in main.go and execute postgresql to create databases.

I generated Go models by doing:

go generate

I got an error:

running "sqlboiler": exec: "sqlboiler": executable file not found in $PATH

I've watched SQLBoiler Screencast but it's assumed user pre configured Sql Boiler

What am i missing?

答案1

得分: 4

这个screencast 从执行以下命令开始:

go get -u -t github.com/vattle/sqlboiler

这一步骤应该会将 sqlboiler 编译并安装到你的 $GOPATH/bin 文件夹中。请确保该文件夹已经添加到你的 PATH 环境变量中。

英文:

The screencast starts with

go get -u -t github.com/vattle/sqlboiler

That step alone should compile and install sqlboiler in your $GOPATH/bin folder. Make sure that folder is part of your PATH.

答案2

得分: 0

你要翻译的内容如下:

你要么缺少二进制文件,要么没有正确配置你的 $PATH

确保 sqlboiler 二进制文件存在于 $GOPATH/bin 目录中。你可以执行以下命令进行验证:

> ls $GOPATH/bin/sqlboiler
/home/cglotr/go/bin/sqlboiler

如果存在,可以像这样配置你的 $PATH

export PATH=$PATH:/home/cglotr/go/bin

现在你应该可以使用 sqlboiler 了。

英文:

You are either missing the binary or didn't configure your $PATH correctly.

Make sure that sqlboiler binary exists in $GOPATH/bin. You can do this to verify:

> ls $GOPATH/bin/sqlboiler
/home/cglotr/go/bin/sqlboiler

If it exists, configure your $PATH like this:

export PATH=$PATH:/home/cglotr/go/bin

Now you should be able to use sqlboiler.

huangapple
  • 本文由 发表于 2017年7月2日 15:51:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/44868580.html
匿名

发表评论

匿名网友

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

确定