Need a better "getting started" guide for Lift
Asked Answered
S

4

11

I have used Scala for about a year and now want to get into Lift. Following the official site, I got the guide at http://simply.liftweb.net/index-Chapter-2.html#toc-Chapter-2

However, the example does not work. Here is the error I get.

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]           ^

I have not used sbt before and prefer not to get sidetracked by having to learn sbt, maven or other stuff. I essentially want a "hello" world application (in this case, the chat application) to start up and running before I do any more digging into Lift.

It is unfortunate that the very first example in the official "getting started" guide is broken. Any ideas what the errors are. I tried the method suggested at http://groups.google.com/group/simple-build-tool/browse_thread/thread/60635edfadbcd816 without any luck

Statistics answered 22/2, 2012 at 10:27 Comment(1)
I recommend you a great code where everything is set - sbt and Lift 2.4. github.com/heiflo/lift-basic-2.4-sbt-0.11.2Subtile
C
4

UPDATE

If what you want is just a "hello" world Lift application, I will suggest you download the official Lift 2.4 release here.

After you unzip that file, just cd scala_28\lift_blank or cd scala_29\lift_blank according to what Scala version you would like to use.

Then run sbt update ~jetty-run, this release included correct version and SBT start script for windows.

After this, you should able to browse http://localhost:8080 and get a single web page that has current date and time displayed, a typical Hello World program for web framework.


It seems you are using SBT 0.11 but Simply Lift is using SBT 0.7.x.

SBT has been made a lot of changes from 0.7.x to 0.11, there is no jetty-run command in 0.11.

You should download old SBT version if you just want it work and do not care using a old version SBT.

http://code.google.com/p/simple-build-tool/downloads/list

I think 0.7.7 will work.

Cub answered 22/2, 2012 at 10:42 Comment(6)
The simply_lift examples bundle the correct version of sbt, so they should "just work".Tramp
But according to the OP's post, he use "C:\scala\bin\sbt-launch.jar" instead the built-in one. And he is using Windows, so the sbt script included in the simply lift will not work either.Cub
Right, though the fact that he is using Windows is a situation I cannot recreate :-) At root, he needs to use the bundled SBT, not his installed version of SBT. So maybe something like "java -Xmx512M -jar ".\sbt-launch.jar" update ~jetty-run" I really have no idea. My opinion is that he'd be best served installing Ubuntu on VirtualBox and using that.Tramp
In facts SBT/Scala/Lift runs very quite well on both Windows and Linux machine, I use it everyday. There is no necessary to using VirtualBox just because want to do the development work.Cub
Thanks. I will check with the old version of SBT. Right now not able to check. Will do it over the weekend and revert.Statistics
I followed your instructions exactly and got... [error] Not a valid project ID: jetty-run [error] Expected ':' (if selecting a configuration) [error] Not a valid key: jetty-run (similar: run) [error] jetty-runDap
T
4

It seems like you don't have ./ on your path. I believe all you need to do is go into the chat folder and use the command "./sbt update ~jetty-run" instead of "sbt update ~jetty-run".

Tramp answered 22/2, 2012 at 15:55 Comment(0)
W
4

It's and old question, but I haven't found that solution anywhere yet:

Seems like in lift 2.5 you should do container:start instead of ~jetty-run, so:

./sbt[enter]
update[enter]
container:start[enter]

My chat app was on http://0.0.0.0:8080

Whodunit answered 31/7, 2013 at 15:9 Comment(0)
L
2
  1. Install SBT 0.11+
  2. Create a folder and follow instructions http://www.assembla.com/wiki/show/liftweb/Using_SBT
  3. Copy src folder of https://github.com/lift/lift_24_sbt/tree/master/scala_29/lift_blank (or lift_basic) in your project folder
  4. cd to your project folder and run sbt.
  5. container:start will start server, container:stop to stop

OR use lifty

Laguna answered 29/2, 2012 at 16:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.