weavejester / ring-serve

Ring development web server
Eclipse Public License 1.0
25 stars 6 forks source link

Unable to make the it work as dev-dependency #2

Open murtaza52 opened 12 years ago

murtaza52 commented 12 years ago

Hi,

I am having a weired problem. When I place ring-serve as a dev-dependency, the repl is not able to find it in its path. I have tried it both with eclipse and clooj and both fail to find it and give me the following exception -

=> (use 'ring.util.serve)

<

FileNotFoundException java.io.FileNotFoundException: Could not locate ring/util/serve__init.class or ring/util/serve.clj on classpath: >

Below is my project.clj -

(defproject ring-hello "1.0.0-SNAPSHOT" :description "FIXME: write description" :dependencies [[org.clojure/clojure "1.3.0"][ring "1.0.1"][compojure "1.0.0"]] :dev-dependencies[[lein-eclipse "1.0.0"][ring-serve "0.1.2"]])

It however works when I have the ring-serve in the dependencies section!

Can someone please help?

Thanks, Murtaza

weavejester commented 12 years ago

What happens if you try it with just lein repl?

steni commented 12 years ago

I am having the same problem in Emacs.

Having done clojure-jack-in, when I use the repl in emacs, I get:

Could not locate ring/util/serve__init.class or ring/util/serve.clj on classpath: [Thrown class java.io.FileNotFoundException]

However, when I use lein repl, then:

(use 'ring.util.serve) nilWarning: html-mode not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic html-mode or change the name. (hiccup/core.clj:9) Warning: base-url not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic base-url or change the name. (hiccup/core.clj:294)

upgradingdave commented 11 years ago

Fwiw, I also ran into the exception:

 => (use 'ring.util.serve)
#<
FileNotFoundException java.io.FileNotFoundException: Could not locate ring/util/serve__init.class or ring/util/serve.clj on classpath: >

until I realized that leiningen 2.x no longer supports :dev-dependencies. I switched to use :profiles and that fixed it for me:

(defproject ring-example "0.1.0-SNAPSHOT"
  :description "First steps with ring"
  :url "http://dev.upgradingdave.com/ring-example"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.4.0"]
                 [ring/ring-core "1.1.6"]
                 [ring/ring-jetty-adapter "1.1.6"]]
  :profiles { :dev {:dependencies [[ring-serve "0.1.3-SNAPSHOT"]]}})

I also updated the logger to work with jetty 7+ here (and taged it as 0.1.3-SNAPSHOT): https://github.com/upgradingdave/ring-serve