首页 > 后端开发 > Golang > 正文

Go Buffalo 测试出现 sqlite 错误:找不到名为 test 的连接

王林
发布: 2024-02-13 12:15:07
转载
639人浏览过

go buffalo 测试出现 sqlite 错误:找不到名为 test 的连接

php小编新一发现,在使用Go Buffalo进行测试时,可能会遇到sqlite错误,提示找不到名为test的连接。这个错误可能会影响测试的正常进行,需要我们找到解决办法。下面将介绍一些可能导致这个错误的原因,并提供解决方法,以帮助开发者顺利解决问题。

问题内容

我使用此命令创建的新项目出现 buffalo 测试错误。

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  
登录后复制

在这个项目上运行测试之前我错过了什么吗?有人请告诉我。谢谢

解决方法

输出的第二行,

挖错网
挖错网

一款支持文本、图片、视频纠错和AIGC检测的内容审核校对平台。

挖错网 28
查看详情 挖错网
[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/ get_started/installation/#custom-installation-with-sqlite3-support

以上就是Go Buffalo 测试出现 sqlite 错误:找不到名为 test 的连接的详细内容,更多请关注php中文网其它相关文章!

相关标签:
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:stackoverflow网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门推荐
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号