【问题标题】:Play application - Push rejected in Heroku播放应用程序 - Heroku 中的推送被拒绝
【发布时间】:2014-04-20 10:07:05
【问题描述】:

我创建了一个 Play 应用程序并使用

将其推送到 heroku
  git push heroku master

那行得通。

然后我推送到我的github账号

  git push -u origin master

成功了。

我在我的应用程序中做了一个小的代码更改,它在我的本地机器上运行良好。当我尝试使用以下步骤推送到 Heroku 时:

  git add .
  git commit -m "comments"
  git push heroku master

它与消息中断:

   [info] Set current project to MyProjectX (in build file:/tmp/scala_buildpack_build_dir/)
   java.util.NoSuchElementException: key not found: SOURCE
   at scala.collection.MapLike$class.default(MapLike.scala:228)
   at scala.collection.AbstractMap.default(Map.scala:58)
   at scala.collection.MapLike$class.apply(MapLike.scala:141)
   ....
   ....
   ....
   [error] (compile:managedSources) java.util.NoSuchElementException: key not found: SOURCE
   [error] Total time: 2 s, completed Mar 14, 2014 9:47:42 PM
   !     Failed to build app with sbt

   !     Push rejected, failed to compile Play 2.x - Scala app

    To git@heroku.com:MyProjectX.git
   ! [remote rejected] master -> master (pre-receive hook declined)
   error: failed to push some refs to 'git@heroku.com:MyProjectX.git'

我不知道为什么当我把它推到heroku时它突然坏了。是不是和github有冲突?谢谢。

【问题讨论】:

标签: heroku github playframework-2.0 sbt


【解决方案1】:

在 Build.scala 中将 play.Project 替换为 sbt.Project 为我解决了这个问题。

另见https://github.com/playframework/playframework/issues/2263#issuecomment-36190502

之前:

val main = play.Project(appName, appVersion, appDependencies)

之后:

val main = sbt.Project(id = appName, base = file("."))
  .settings(
    version := appVersion,
    libraryDependencies ++= appDependencies
  )

【讨论】:

    【解决方案2】:

    heroku config:set SBT_CLEAN=true 应该可以解决这个问题

    更多Heroku Help Page

    【讨论】:

      猜你喜欢
      • 2016-08-14
      • 2014-08-19
      • 1970-01-01
      • 2016-12-04
      • 2017-01-09
      • 2021-09-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多