我已经使用 Scala 大约一年了,现在想进入 Lift。 按照官方网站,我得到了指南:http://simply.liftweb.net/index-Chapter-2.html#toc-Chapter-2
但是,该示例不起作用。这是我收到的错误。
C:\Lift\hello>sbt update ~jetty-run
C:\Lift\hello>set SCRIPT_DIR=C:\scala\bin\
C:\Lift\hello>java -Xmx512M -jar "C:\scala\bin\sbt-launch.jar" update ~jetty-run
[info] Set current project to default-7944be (in build file:/C:/Lift/hello/)
[success] Total time: 0 s, completed 22 Feb, 2012 3:41:06 PM
[error] Not a valid command: jetty-run
[error] Not a valid project ID: jetty-run
[error] Not a valid configuration: jetty-run
[error] Not a valid key: jetty-run (similar: run)
[error] ~jetty-run
[error] ^
我以前没有使用过 sbt,并且不想因为必须学习 sbt、maven 或其他东西而分心。我本质上希望在我进一步深入研究 Lift 之前启动并运行一个“hello”世界应用程序(在本例中为聊天应用程序)。
不幸的是,官方“入门”指南中的第一个示例已损坏。任何想法有什么错误。我尝试了http://groups.google.com/group/simple-build-tool/browse_thread/thread/60635edfadbcd816中建议的方法没有任何运气
最佳答案
更新
如果你想要的只是一个“hello”world Lift应用程序,我会建议你download the official Lift 2.4 release here .
解压缩该文件后,只需根据您要使用的 Scala 版本cd scala_28\lift_blank
或 cd scala_29\lift_blank
即可。
然后运行sbt update ~jetty-run
,此版本包含正确的版本和适用于Windows的SBT启动脚本。
此后,您应该可以浏览 http://localhost:8080并获取一个显示当前日期和时间的网页,这是一个典型的 Web 框架 Hello World 程序。
<小时/>您似乎使用的是 SBT 0.11,但 Simply Lift 使用的是 SBT 0.7.x。
SBT从0.7.x到0.11做了很多改变,0.11中没有jetty-run命令。
如果您只想让它工作并且不关心使用旧版本的 SBT,则应该下载旧的 SBT 版本。
http://code.google.com/p/simple-build-tool/downloads/list
我认为 0.7.7 可以工作。
关于scala - 需要更好的 Lift "getting started"指南,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9393032/