2014-12-04 30 views
4

我正在嘗試爲compojure構建hello-world示例,但未能啓動環任務。lein ring server:「這不是一項任務」

$ 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. 

我使用Hello世界上發光site,這也說,它無法找到工作或其他的例子,其中雷音抱怨說我使用了錯誤的參數數目甚至還試圖如果我從tutorial直接拉線。

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

回答

6

我quess你缺少環和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}) 

當然,你必須在src/compojure/core.clj定義一個處理函數!見herehere for a very nice introduction

相關問題