gpt4 book ai didi

git - 在 Heroku 上部署 Play Framework 2.4 时出错

转载 作者:太空狗 更新时间:2023-10-29 14:45:01 25 4
gpt4 key购买 nike

我正在尝试在 Heroku 上部署一个 Play Framework (Java) 应用程序 (v 2.4),但是当我执行命令时 git push heroku master我得到以下异常:

remote:        [warn]   ::::::::::::::::::::::::::::::::::::::::::::::
remote: [warn] :: UNRESOLVED DEPENDENCIES ::
remote: [warn] ::::::::::::::::::::::::::::::::::::::::::::::
remote: [warn] :: com.typesafe.sbtrc#client-2-11;0.3.1: not found
remote: [warn] :: com.typesafe.sbtrc#actor-client-2-11;0.3.1: not found
remote: [warn] ::::::::::::::::::::::::::::::::::::::::::::::
remote: [warn]
remote: [warn] Note: Unresolved dependencies path:
remote: [warn] com.typesafe.sbtrc:client-2-11:0.3.1
remote: [warn] +- com.typesafe.play:fork-run-protocol_2.11:2.4.3 ((play.sbt.forkrun.PlayForkRun) PlayForkRun.scala#L48)
remote: [warn] +- com.typesafe.play:fork-run_2.11:2.4.3 ((play.sbt.forkrun.PlayForkRun) PlayForkRun.scala#L48)
remote: [warn] +- escarbajo:escarbajo_2.11:1.0-SNAPSHOT
remote: [warn] com.typesafe.sbtrc:actor-client-2-11:0.3.1
remote: [warn] +- com.typesafe.play:fork-run_2.11:2.4.3 ((play.sbt.forkrun.PlayForkRun) PlayForkRun.scala#L48)
remote: [warn] +- escarbajo:escarbajo_2.11:1.0-SNAPSHOT
remote: sbt.ResolveException: unresolved dependency: com.typesafe.sbtrc#client-2-11;0.3.1: not found
remote: unresolved dependency: com.typesafe.sbtrc#actor-client-2-11;0.3.1: not found
remote: at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:291)
remote: at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:188)
remote: at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:165)
remote: at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
remote: at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
remote: at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:132)
remote: at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
remote: at sbt.IvySbt$$anon$4.call(Ivy.scala:65)
remote: at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
remote: at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
remote: at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
remote: at xsbt.boot.Using$.withResource(Using.scala:10)
remote: at xsbt.boot.Using$.apply(Using.scala:9)
remote: at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
remote: at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
remote: at xsbt.boot.Locks$.apply0(Locks.scala:31)
remote: at xsbt.boot.Locks$.apply(Locks.scala:28)
remote: at sbt.IvySbt.withDefaultLogger(Ivy.scala:65)
remote: at sbt.IvySbt.withIvy(Ivy.scala:127)
remote: at sbt.IvySbt.withIvy(Ivy.scala:124)
remote: at sbt.IvySbt$Module.withModule(Ivy.scala:155)
remote: at sbt.IvyActions$.updateEither(IvyActions.scala:165)
remote: at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1369)
remote: at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1365)
remote: at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$87.apply(Defaults.scala:1399)
remote: at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$87.apply(Defaults.scala:1397)
remote: at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37)
remote: at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1402)
remote: at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1396)
remote: at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60)
remote: at sbt.Classpaths$.cachedUpdate(Defaults.scala:1419)
remote: at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1348)
remote: at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1310)
remote: at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
remote: at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
remote: at sbt.std.Transform$$anon$4.work(System.scala:63)
remote: at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
remote: at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
remote: at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
remote: at sbt.Execute.work(Execute.scala:235)
remote: at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
remote: at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
remote: at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
remote: at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
remote: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
remote: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
remote: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
remote: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
remote: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
remote: at java.lang.Thread.run(Thread.java:745)
remote: [error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.sbtrc#client-2-11;0.3.1: not found
remote: [error] unresolved dependency: com.typesafe.sbtrc#actor-client-2-11;0.3.1: not found
remote: [error] Total time: 20 s, completed Oct 24, 2015 9:02:27 PM
remote:
remote: ! ERROR: Failed to run sbt!
remote: We're sorry this build is failing. If you can't find the issue in application
remote: code, please submit a ticket so we can help: https://help.heroku.com
remote: You can also try reverting to the previous version of the buildpack by running:
remote: $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-scala#previous-version
remote:
remote: Thanks,
remote: Heroku
remote:
remote:
remote: ! Push rejected, failed to compile Play 2.x - Java app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to protected-lowlands-4290.
remote:
To https://git.heroku.com/protected-lowlands-4290.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/protected-lowlands-4290.git'

我到处寻找解决方案,发现了一些对其他人有用的东西,但在这种情况下却行不通。我尝试了以下方法:

  1. 添加行 project/play-fork-run.sbt.gitignore文件。
  2. 删除文件play-fork-run.sbt .
  3. 将这些解析器添加到 build.stb文件:
    resolvers += Resolver.url("Typesafe Ivy", url("<a href="http://repo.typesafe.com/typesafe/ivy-snapshots" rel="noreferrer noopener nofollow">http://repo.typesafe.com/typesafe/ivy-snapshots</a>"))(Resolver.ivyStylePatterns)
    resolvers += "Typesafe" at "<a href="http://repo.typesafe.com/typesafe/releases/" rel="noreferrer noopener nofollow">http://repo.typesafe.com/typesafe/releases/</a>"

但似乎没有任何效果,当我在本地主机上编译并运行该应用程序时,它运行良好。

有解决这个问题的想法吗?

非常感谢任何帮助!

谢谢

最佳答案

这在 localhost 上起作用的原因是您可能在某个时候运行了 activator,它将有问题的依赖项下载到您的本地 .ivy2 缓存中。但在 Heorku 上,只有 sbt 运行,并且激活器中存在一个长期未修复的主要错误,导致激活器和 sbt 之间的解析器不同。

听起来您已经看过这些报告,其中包含一些建议(大部分是您已经尝试过的):

潜在的问题是对此的依赖:

addSbtPlugin("com.typesafe.play" % "sbt-fork-run-plugin" % "2.4.3")

仔细检查 project/ 下的所有 sbt 文件,确保其中没有任何依赖项。在推送到 Heroku 之前,还要确保您的 Git 存储库更改已提交。

最后,如果您仍然卡住了,您可以切换到使用 sbt-heroku plugin ,它使用本地编译的 Assets 并将它们部署到 Heroku。这将一起避免这个问题。

此外,我建议您在 Play mailing list 上提出这个问题.这是一个长期存在的问题,我遇到过很多人遇到过这个问题。 Typesafe 的工作人员需要听取用户的意见,了解这种情况有多猖獗。

关于git - 在 Heroku 上部署 Play Framework 2.4 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33323623/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com