2
votes

I'm in the process of trying to learn clojure, but most of the tutorials and sample code that I look at all fails to run for me.

Whenever I try to start a ring app with "lein ring server-headless", it downloads all the dependencies, then dies with a big stacktrace, as it can't find leiningen.core.project$reduce_repo_step:

Exception in thread "main" java.lang.ClassNotFoundException: leiningen.core.project$reduce_repo_step, compiling:(/tmp/form-init4519196078572752752.clj:1)
at clojure.lang.Compiler.load(Compiler.java:6958)
at clojure.lang.Compiler.loadFile(Compiler.java:6912)
at clojure.main$load_script.invoke(main.clj:283)
at clojure.main$init_opt.invoke(main.clj:288)
at clojure.main$initialize.invoke(main.clj:316)
at clojure.main$null_opt.invoke(main.clj:349)

Examples of code where this happens are the samples/tutorials at https://github.com/kendru/restful-clojure and https://github.com/diamondap/ring-sample

Is something wrong with my leiningen/clojure local setup? I'm using leiningen 2.6.0 on linux mint.

2
Does the project start if you run lein repl?Bill
Yes, it does. Turns out that downgrading to lein 2.5.3 fixed the issue. Is this just a bug between lein-ring and lein?Nathan T

2 Answers

2
votes

The tutorials you linked to seem to be using old versions of ring—1.2.1 and 1.1.0. I noticed that if you make a new luminus project:

lein new luminus guestbook +h2

you end up with ring version 1.4.0. You might consider using a more up-to-date tutorial. I've been using the official Luminus tutorial.

0
votes

Ah, there's now a bug report for it. I'm satisfied with the answer "it's a bug"

https://github.com/technomancy/leiningen/issues/2079