【发布时间】:2012-12-08 20:19:14
【问题描述】:
我正在尝试将本地工作的应用程序推送到 Heroku,但出现此错误
[info] Compiling 20 Scala sources and 12 Java sources to /tmp/build_mhfyee4j841a/target/scala-2.9.1/classes...
[error] /tmp/build_mhfyee4j841a/target/scala-2.9.1/src_managed/main/views/html/showitem.template.scala:74: value showItem is not a member of controllers.ReverseApplication
[error] <a href=""""),_display_(Seq[Any](/*45.21*/routes/*45.27*/.Application.showItem(p.id, Items.slugify(p.title)))),format.raw/*45.78*/("""" ><img width="110" height="110" alt=""""),_display_(Seq[Any](/*45.118*/p/*45.119*/.title)),format.raw/*45.125*/("""" src=""""),_display_(Seq[Any](/*45.133*/p/*45.134*/.picture)),format.raw/*45.142*/(""""></a>
[error] ^
[error] one error found
[error] {file:/tmp/build_mhfyee4j841a/}quoiacheter/compile:compile: Compilation failed
[error] Total time: 25 s, completed Dec 8, 2012 8:07:38 PM
! Failed to build app with sbt
! Heroku push rejected, failed to compile Play 2.0 - java app
正如我之前所说,应用程序在本地运行良好,您可以在此处查看 showitem 模板中应该有错误的部分
<p>
@for(p <- Items.getRelated(item.categories.get(0).id) ) {
<a href="@routes.Items.showItem(p.id, Items.slugify(p.title))" ><img width="110" height="110" alt="@p.title" src="@p.picture"></a>
}
</p>
Heroku 认为我正在调用 @routes.Application.showItem 而不是 @routes.Items.showItem !你可以在这里看到我的路线文件的相关部分:
...
# ITEMS
GET /items/:id/:title controllers.Items.showItem(id: Long,title: String)
...
【问题讨论】:
-
在本地运行
play clean然后play stage会发生什么?
标签: deployment heroku playframework playframework-2.0