使用Play 2.3创建新项目时出错

时间:2015-09-17 13:23:28

标签: scala sbt playframework-2.3

我使用的是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:object scala.runtime   在编译器镜像中找不到。

     

在   scala.reflect.internal.MissingRequirementError $。信号(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)       at xsbt.boot.Boot $ .runImpl(Boot.scala:44)       at xsbt.boot.Boot $ .main(Boot.scala:20)       at xsbt.boot.Boot.main(Boot.scala)[error] scala.reflect.internal.MissingRequirementError:object scala.runtime   在编译器镜像中找不到。 [error]使用'last'作为完整日志。   项目加载失败:(r)etry,(q)uit,(l)ast,或(i)gnore?

1 个答案:

答案 0 :(得分:0)

据我所知,只有Play 2.4支持注入生成器,即 routesGenerator:= InjectedRoutesGenerator

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