lein ring server: "That's not a task"

I'm trying to build the hello-world example for compojure and it's failing to start the ring task.

$ lein version
Leiningen 1.7.1 on Java 1.7.0_65 OpenJDK 64-Bit Server VM
$ lein new compojure test
Created new project in: /home/myaccount/test
Look over project.clj and start coding in compojure/core.clj
$ cd test/
$ lein ring server
That's not a task. Use "lein help" to list all tasks.

I've also tried using the hello-world on the luminous site, which also says it can't find that task or other examples, where lein complains that I'm using the wrong number of arguments even if I pull the line straight from their tutorial.

$ lein new luminus guestbook +h2
Wrong number of arguments to new task. 
Expected ([project-name] [project-name project-dir])

I quess you are missing the ring and compjure plugins in the project.clj file:

(defproject compojure "1.0.0-SNAPSHOT"
   :description "FIXME: write description"
   :dependencies [[org.clojure/clojure "1.3.0"]]
   :plugins [[lein-ring "0.8.8"]
             [compojure "1.1.6"]]

   ;; once you have the above, you'll see that you need
   ;; to configure ring. This is the most simple example:
   :ring {:handler compojure.core/handler})

Of course you have to define a handler function in src/compojure/core.clj ! See here or here for a very nice introduction.

链接地址: http://www.djcxy.com/p/56986.html

上一篇: 刷新覆盖请求正文?

下一篇: 莱恩环服务器:“这不是一项任务”