lein ring server:"那不是任务"

voo*_*ant 8 clojure compojure leiningen luminus

我正在尝试为compojure构建hello-world示例,但它无法启动响铃任务.

$ 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.
Run Code Online (Sandbox Code Playgroud)

我也试过在发光网站上使用hello-world ,这也说它无法找到那个任务或其他例子,lein抱怨我使用了错误的参数数量,即使我直接从他们的教程.

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

ric*_*cma 9

我想你错过了文件中的环和compjure 插件project.clj:

(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})
Run Code Online (Sandbox Code Playgroud)

当然你必须定义一个处理函数src/compojure/core.clj!在这里这里看到一个非常好的介绍.