beego 打包部署到线上的问题
开发环境是windows
使用bee pack -be GOOS=linux
命令打包部署到Linux Centos
后访问域名提示mybeego:can't find templatefile in the path:views/index.tpl
,项目是 bee 工具生成的初始项目。刚接触 beego 不是很懂,为什么打包到 Linux 后错误提示还会有 Windows 下的目录路径的(C:/Go/src/runtime/panic.go:679
),是不是打包的环节少了点什么?
下图是服务器上的目录:
更新:
解决了,因为我是/topath/appname
这样运行go程序的,改成cd /topath
./appname
这样运行就不存在以上问题了