Hey, I'm new to Clojure and Leiningen and am a bit stuck. I managed to set up a project with Leiningen. I can compile it in uberjar and run repl . I also managed to load a dependency named aleph to run a simple parallel web server.
The next step for me is to use redis-clojure to access redis. But here I am stuck. This is my project.clj :
(defproject alpha "0.0.1-SNAPSHOT" :description "Just an alpha test script" :main alpha.core :dependencies [[org.clojure/clojure "1.2.0"] [org.clojure/clojure-contrib "1.2.0"] [aleph, "0.1.2-SNAPSHOT"] [redis-clojure "1.2.4"]])
And here is my core.clj : Notice that I added the line (:requre redis) according to the example from redis-clojure.
(ns alpha.core (:require redis) (:gen-class)) (use `aleph.core 'aleph.http) (defn alpha [channel request] (let [] (enqueue-and-close channel {:status 200 :header {"Content-Type" "text/html"} :body "Hello Clojure World!"})) (println (str request))) (defn -main [& args] (start-http-server alpha {:port 9292}))
When I try to run lein repl , this happens:
java.io.FileNotFoundException: Could not locate redis__init.class or redis.clj on classpath: (core.clj:1)
Yes, I ran lein deps , and the redis-clojure banner is available in my lib directory. I probably missed something trivial, but now I have been working on this issue for several hours and am not getting closer to the solution. Thanks!
source share