【问题标题】:lein ring server: "That's not a task"lein ring server:“这不是任务”
【发布时间】:2015-02-01 22:52:48
【问题描述】:

我正在尝试为 compojure 构建 hello-world 示例,但无法启动 ring 任务。

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

我还尝试在发光的site 上使用 hello-world,它还说它找不到该任务或其他示例,其中 lein 抱怨我使用了错误数量的参数,即使我直接从他们的tutorial 拉线。

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

【问题讨论】:

    标签: clojure leiningen compojure luminus


    【解决方案1】:

    我怀疑你在project.clj 文件中缺少戒指和compjure 插件

    (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

    【讨论】:

      猜你喜欢
      • 2013-07-16
      • 2014-08-19
      • 2013-03-25
      • 2017-09-03
      • 2015-04-28
      • 2019-01-21
      • 1970-01-01
      • 2022-12-24
      • 2020-09-07
      相关资源
      最近更新 更多