【问题标题】:Error while creating new project with Play 2.3使用 Play 2.3 创建新项目时出错
【发布时间】:2015-12-14 09:18:21
【问题描述】:

我正在使用 scala 2.11.1、sbt 0.13.5 和 Play 2.3。我在创建新项目时遇到问题

当我跑步时

activator new sampleapp play-scala

它创建一个名为“sampleapp”的目录

然后当我进入目录并运行activator 命令时会报错

这是我自动生成的 sbt 文件

name := """demo"""

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.1"

libraryDependencies ++= Seq(
  jdbc,
  cache,
  ws,
  specs2 % Test
)

resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"

// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator

这是我的堆栈跟踪

scalaworkspace/sessiondemo$ activator [info] 加载项目 /home/ahsen/scalaworkspace/demo/project 错误的定义: 加载时出错,zip文件为空 scala.reflect.internal.MissingRequirementError:对象scala.runtime 在编译器镜像中找不到。

在 scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:16) 在 scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:17) 在 scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:48) 在 scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:40) 在 scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:61) 在 sbt.xMain.run(Main.scala:28) 在 xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109) 在 xsbt.boot.Launch$.withContextLoader(Launch.scala:129) 在 xsbt.boot.Launch$.run(Launch.scala:109) 在 xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:36) 在 xsbt.boot.Launch$.launch(Launch.scala:117) 在 xsbt.boot.Launch$.apply(Launch.scala:19) 在 xsbt.boot.Boot$.runImpl(Boot.scala:44) 在 xsbt.boot.Boot$.main(Boot.scala:20) 在 xsbt.boot.Boot.main(Boot.scala) [错误] scala.reflect.internal.MissingRequirementError: object scala.runtime 在编译器镜像中找不到。 [错误] 对完整日志使用“最后一个”。 项目加载失败:(r)etry、(q)uit、(l)ast 还是 (i)gnore?

【问题讨论】:

    标签: scala sbt playframework-2.3


    【解决方案1】:

    据我所知,注入生成器,即 routesGenerator := InjectedRoutesGenerator,仅在 Play 2.4 中受支持。

    看看这个。 https://www.playframework.com/documentation/2.4.x/Migration24

    【讨论】:

      猜你喜欢
      • 2017-07-23
      • 1970-01-01
      • 2017-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-15
      • 2021-05-20
      • 2019-01-28
      相关资源
      最近更新 更多