为什么 Revel web 框架教程应用程序不起作用?

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

why Revel web framework tutorial app doesnt work

问题

我是一个Go语言的初学者,我想使用revel web框架来开发Web应用程序。

我按照教程从以下网址安装和测试revel:
http://revel.github.io/tutorial/index.html

但是当我运行revel run myapp命令并访问http://localhost:9000/时,
页面显示了一个错误,错误信息如下:

> 服务器错误:模板执行错误(在app/index.html的第23行):
> "footer.html"是一个不完整或空的模板
>
> 此外,在渲染错误页面时发生了错误:
> html/template:errors/500.html:"errors/500.html"是一个不完整或空的模板

我尝试删除了这句话:

> {{ template "footer.html" .}}

现在它可以工作了,但这不是一个真正解决问题的方法。

有其他人之前遇到过这个问题吗?

英文:

I'm a beginner in Go and I want to use the revel web framework to develop web applications.

I followed the tutorial to install and test revel from:
http://revel.github.io/tutorial/index.html

But when I run the revel run myapp command and go to http://localhost:9000/,
the page shows an error that says:

> Server Error: Template Execution Error (in app/index.html:23):
> "footer.html" is an incomplete or empty template
>
> Additionally, an error occurred when rendering the error page:
> html/template:errors/500.html: "errors/500.html" is an incomplete or
> empty template

I tried to remove the sentence:

> {{ template "footer.html" .}}

Now it works, but this is not a real solution to the problem.

Has somebody else had this problem before ?

答案1

得分: 1

你需要安装更新的Go版本1.2(而不是1.1.2)。
<br>
这里有一个适用于Ubuntu的简短教程。

英文:

You need to install a newer Go version 1.2 (not 1.1.2).
<br>
Here is a small tutorial for Ubuntu.

huangapple
  • 本文由 发表于 2014年8月13日 02:32:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/25271616.html
匿名

发表评论

匿名网友

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

确定