lein ring server: "That's not a task"
Asked Answered
S

1

9

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])
Severance answered 4/12, 2014 at 6:23 Comment(1)
also: check that you are within the project directoryGroove
C
10

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.

Coatee answered 4/2, 2015 at 21:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.