Go语言 使用sqlite错误进行布法罗测试:找不到名为test的连接

e3bfsja2  于 2023-03-16  发布在  Go
关注(0)|答案(1)|浏览(135)

布法罗测试错误的一个新项目,我创建了这个命令。

buffalo new coke --db-type sqlite3
buffalo test

下面是错误:

[POP] 2023/02/23 13:43:02 warn - unable to load connection development: could not create new connection: sqlite3 support was not compiled into the binary
[POP] 2023/02/23 13:43:02 warn - unable to load connection test: could not create new connection: sqlite3 support was not compiled into the binary
[POP] 2023/02/23 13:43:02 warn - unable to load connection production: could not create new connection: sqlite3 support was not compiled into the binary
Usage:
  buffalo test [flags]

Flags:
  -h, --help   help for test

ERRO[0000] Error: could not find connection named test

在这个项目上运行测试之前,我错过了什么吗?请让我知道。谢谢

34gzjxbg

34gzjxbg1#

输出的第二行,

[POP] 2023/02/23 13:43:02 warn - <...>: sqlite3 support was not compiled into the binary

正如您在此处所看到的,根本原因是您的buffalo二进制文件未编译为支持SQLite3。您是如何安装它的?如果您使用go install,则应使用-tags sqlite选项,因此类似这样的命令应为

go install -tags sqlite github.com/gobuffalo/cli/cmd/buffalo@latest

有关更多安装选项,请参阅文档。
https://gobuffalo.io/documentation/getting_started/installation/#custom-installation-with-sqlite3-support

相关问题