Forgejo本地用go run main.go运行遇模板错误,编译后正常求原因
go run main.go模板文件找不到问题分析 从官方文档从源码搭建Forgejo后,使用go run main.go本地运行程序,访问localhost:3000时遇到如下错误:
Unable to render status/500 page, the template system is broken, or Gitea can't find your template files.
奇怪的是,先执行go build main.go编译再运行则无此问题。网上有类似问题帖,但因我的系统未运行其他服务,其解决方案不适用。请问有人能分析该问题成因吗?
我的搭建步骤为:
npm install go mod tidy make clean make frontend make backend
完整错误日志如下:
2024/10/02 13:31:26 .../i18n/localestore.go:131:TrString() [E] Missing translation "install.install"
2024/10/02 13:31:26 .../context_response.go:91:HTML() [E] Render failed: failed to render template: install, error: asset from: , template "install" not found
2024/10/02 13:31:26 ...eb/routing/logger.go:102:func1() [I] router: completed GET / for [::1]:61953, 200 OK in 1.0ms @ install/install.go:87(install.Install)
感谢您的帮助!
PS:Stackoverflow目前无“Forgejo”标签
内容的提问来源于stack exchange,提问作者Michael Sparrow

