推出2.0.x应用程序到Heroku问题

时间:2012-12-08 20:19:15

标签: deployment heroku playframework playframework-2.0

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

1 个答案:

答案 0 :(得分:0)

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