[info] Compiling 20 Scala sources to /home/ze/Project/dm6467t-cn/target/scala-2.9.1/classes...
[error] /home/ze/Project/dm6467t-cn/target/scala-2.9.1/src_managed/main/routes_routing.scala:14: object creation impossible, since:
[error] method prefix in trait Routes of type => String is not defined
[error] method setPrefix in trait Routes of type (prefix: String)Unit is not defined
[error] object Routes extends Router.Routes {
[error] ^
[error] one error found
[error] {file:/home/ze/Project/dm6467t-cn/}dm6467t-cn/compile:compile: Compilation failed[error] application -
! Internal server error, for request [GET /] ->
sbt.PlayExceptions$CompilationException: Compilation error [object creation impossible, since:
method prefix in trait Routes of type => String is not definedmethod setPrefix in trait Routes of type (prefix: String)Unit is not defined]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12$$anonfun$apply$13
.apply(PlayReloader.scala:223) ~[na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12$$anonfun$apply$13
.apply(PlayReloader.scala:223) ~[na:na]
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.apply(PlayReloader.scala:223) ~[na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.apply(PlayReloader.scala:220) ~[na:na]
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3]
[error] /home/ze/Project/dm6467t-cn/target/scala-2.9.1/src_managed/main/routes_routing.scala:14: object creation impossible, since:
[error] method prefix in trait Routes of type => String is not defined
[error] method setPrefix in trait Routes of type (prefix: String)Unit is not defined
[error] object Routes extends Router.Routes {
[error] ^
[error] one error found
[error] {file:/home/ze/Project/dm6467t-cn/}dm6467t-cn/compile:compile: Compilation failed[error] application -
! Internal server error, for request [GET /] ->
sbt.PlayExceptions$CompilationException: Compilation error [object creation impossible, since:
method prefix in trait Routes of type => String is not definedmethod setPrefix in trait Routes of type (prefix: String)Unit is not defined]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12$$anonfun$apply$13
.apply(PlayReloader.scala:223) ~[na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12$$anonfun$apply$13
.apply(PlayReloader.scala:223) ~[na:na]
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.apply(PlayReloader.scala:223) ~[na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.apply(PlayReloader.scala:220) ~[na:na]
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3]
造成上述原因有两个:
- 第一个是版本问题,你运行的项目很可能是用Play 2.0.4或者低于项目构建版本;
- 第二个是你的project/plugins.sbt有问题,比如说,
// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.1-06052012")
这时就要把其中的2.1-06052012改成2.0.4或2.0.3