Scala 电梯启动故障

Scala 电梯启动故障,scala,lift,Scala,Lift,我正在运行lift in Action的第一个lift web应用程序。当我在运行sbt之后运行jetty命令时,我得到以下结果: [root@localhost lift-app]# sbt [info] Building project lift-travel 1.0 against Scala 2.8.0 [info] using LiftProject with sbt 0.7.7 and Scala 2.7.7 > jetty [info] [info] == copy-

我正在运行lift in Action的第一个lift web应用程序。当我在运行sbt之后运行jetty命令时,我得到以下结果:

[root@localhost lift-app]# sbt
[info] Building project lift-travel 1.0 against Scala 2.8.0
[info]    using LiftProject with sbt 0.7.7 and Scala 2.7.7
> jetty
[info] 
[info] == copy-resources ==
[info] == copy-resources ==
[info] 
[info] == compile ==
[info]   Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[info] Compiling main sources...
[error] /home/Ramy/lift-app/src/main/scala/bootstrap/liftweb/Boot.scala:5: value liftweb is not a member of package net
[error] import net.liftweb._
[error]            ^
[error] one error found
[info] == compile ==
[error] Error running compile: Compilation failed
[info] 
[info] Total time: 3 s, completed Jan 29, 2012 8:11:59 PM

如果需要,我可以发布我的配置,但我希望这已经足够了。

我认为您需要在SBT中使用
update
命令来首先下载lift JAR文件。

我认为您需要在SBT中使用
update
命令来首先下载lift JAR文件。

出于某种原因,规范库不再位于存储库中

除非您绝对需要规范单元测试,否则您可以注释掉依赖项。只需转到此行
val specs=“org.scala tools.testing“%%”specs“%%”1.6.6“%”test->default“

并将其注释出来,sbt将很好地运行

来自大卫·波拉克(来自liftweb@goolegroups邮件列表):


由于某些原因,规范库不再位于存储库中

除非您绝对需要规范单元测试,否则您可以注释掉依赖项。只需转到此行
val specs=“org.scala tools.testing“%%”specs“%%”1.6.6“%”test->default“

并将其注释出来,sbt将很好地运行

来自大卫·波拉克(来自liftweb@goolegroups邮件列表):


使用sbt reload这个问题已经为我解决了。

使用sbt reload这个问题已经为我解决了。

自从我回答我自己的问题以来,Scala可能改变了很多。:-)自从我回答了自己的问题后,Scala可能发生了很多变化。:-)
import sbt._

class LiftProject(info: ProjectInfo) extends DefaultWebProject(info) {
  val liftVersion = "2.1"

  /**
   * Application dependencies
   */
  val webkit    = "net.liftweb" %% "lift-webkit" % liftVersion % "compile->default"
  val logback   = "ch.qos.logback" % "logback-classic" % "0.9.26" % "compile->default"

  val servlet   = "javax.servlet" % "servlet-api" % "2.5" % "provided->default"
  val jetty6    = "org.mortbay.jetty" % "jetty" % "6.1.22" % "test->default"  
  val junit     = "junit" % "junit" % "4.5" % "test->default"
  //val specs     = "org.scala-tools.testing" %% "specs" % "1.6.6" % "test->default"
  val mapper = "net.liftweb" %% "lift-mapper" % liftVersion

  /**
   * Maven repositories
   */
  lazy val scalatoolsSnapshots = ScalaToolsSnapshots
}
Scala is very version fragile.  That means that a version of a library must be compiled against the same version of Scala and any other dependent libraries.

Specs bumps its version number for each Scala release.  So, if you change the version of Scala, the particular version of Specs will not be found because it does not match the given version of Scala.  You can find the correct version of Specs for the given version of Scala on the Specs home page: http://code.google.com/p/specs/