【问题标题】:Pushing play 2.0.x app to Heroku issue将 play 2.0.x 应用程序推送到 Heroku 问题
【发布时间】: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


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2011-02-26
    • 1970-01-01
    • 2011-09-20
    • 2014-06-20
    • 2020-06-10
    • 1970-01-01
    • 2010-12-30
    • 1970-01-01
    • 2011-06-14
    相关资源
    最近更新 更多