8

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.

また、ルミナスサイトでhello-world を使用してみましたが、そのタスクや他の例が見つからないというメッセージも表示されています。彼らのチュートリアル

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

1 に答える 1

9

ファイルに ring と 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!でハンドラ関数を定義する必要があります。非常に素晴らしい紹介については、ここまたはここを参照してください。

于 2015-02-04T21:18:26.303 に答える