Try add explicit import of actor classes/objects, and declare implicit actor system val. Like this:
import spray.routing.SimpleRoutingApp
import akka.actor._
object Main extends App with SimpleRoutingApp {
implicit val system = ActorSystem("my-system")
startServer(interface = "localhost", port = 8080) {
path("hello") {
get {
complete {
<h1>Say hello to spray</h1>
}
}
}
}
}
You should also need to make sure that whatever in Dependencies.scala is picked up by build.sbt. Try remove Dependencies.scala file and add the dependencies to build.sbt like this,
name := """spray-rest"""
version := "1.0"
scalaVersion := "2.10.3"
resolvers += "spray repo" at "http://repo.spray.io"
resolvers += "spray nightlies" at "http://nightlies.spray.io"
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.2.3",
"com.typesafe.akka" %% "akka-slf4j" % "2.2.3",
"ch.qos.logback" % "logback-classic" % "1.0.13",
"io.spray" % "spray-can" % "1.2-RC2",
"io.spray" % "spray-routing" % "1.2-RC2",
"io.spray" %% "spray-json" % "1.2.3",
"org.specs2" %% "specs2" % "1.14" % "test",
"io.spray" % "spray-testkit" % "1.2-RC2" % "test",
"com.typesafe.akka" %% "akka-testkit" % "2.2.3" % "test",
"com.novocode" % "junit-interface" % "0.7" % "test->default"
)
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-Xlint",
"-Ywarn-dead-code",
"-language:_",
"-target:jvm-1.7",
"-encoding", "UTF-8"
)
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v")