1

我正在尝试将本地工作的应用程序推送到 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)
...
4

1 回答 1

0

发生这种情况的唯一原因是,如果您的git存储库不是最新的,并且在 git 存储库中以某种方式调用Application,而不是Items. 请检查您是否确实将更改提交到git本地。

于 2012-12-11T12:14:12.753 回答