duct-framework / duct

Server-side application framework for Clojure
MIT License
1.13k stars 51 forks source link

requiring clojure.repl breaks for me #18

Closed ibawt closed 9 years ago

ibawt commented 9 years ago

solution

remove the require or namespace etc.

replication steps

➜  @meiko devel  lein new duct blagum +cljs +example +sqlite +site
Generating a new Duct project named blagum...
Run 'lein setup' in the project directory to create local config files.
➜  @meiko devel  cd blagum
➜  @meiko blagum  lein setup
Creating file dev/local.clj
Creating file profiles.clj
➜  @meiko blagum  lein repl
Exception in thread "main" java.lang.IllegalStateException: root-cause already refers to: #'clojure.repl/root-cause in namespace: user, compiling:(/private/var/folders/dy/126d47hn03lfr840p3hnwhvm0000gn/T/form-init4340442744038424403.clj:1:125)
    at clojure.lang.Compiler.load(Compiler.java:7239)
    at clojure.lang.Compiler.loadFile(Compiler.java:7165)
    at clojure.main$load_script.invoke(main.clj:275)
    at clojure.main$init_opt.invoke(main.clj:280)
    at clojure.main$initialize.invoke(main.clj:308)
    at clojure.main$null_opt.invoke(main.clj:343)
    at clojure.main$main.doInvoke(main.clj:421)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:383)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)
Caused by: java.lang.IllegalStateException: root-cause already refers to: #'clojure.repl/root-cause in namespace: user
    at clojure.lang.Namespace.warnOrFailOnReplace(Namespace.java:88)
    at clojure.lang.Namespace.reference(Namespace.java:110)
    at clojure.lang.Namespace.refer(Namespace.java:168)
    at clojure.core$refer.doInvoke(core.clj:4098)
    at clojure.lang.RestFn.invoke(RestFn.java:410)
    at clojure.lang.AFn.applyToHelper(AFn.java:154)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at clojure.core$apply.invoke(core.clj:632)
    at clojure.core$load_lib.doInvoke(core.clj:5730)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:632)
    at clojure.core$load_libs.doInvoke(core.clj:5749)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
weavejester commented 9 years ago

I can't reproduce the error you have when following the steps you supply. Usually this is due to plugins or dependencies in your ~/.lein/profiles.clj file that are conflicting with Duct in some way.

Could you post your Leiningen and Java versions, along with any global plugins or dependencies you happen to be using?

ibawt commented 9 years ago
        :plugins [[cider/cider-nrepl "0.10.0-SNAPSHOT"]
                  [lein-ancient "0.6.5"]
                  [jonase/eastwood "0.2.1"]
                  [lein-kibit "0.1.2"]
                  [refactor-nrepl "2.0.0-SNAPSHOT"]]

        :dependencies [[pjstadig/humane-test-output "0.7.0"]
                       [org.clojure/tools.nrepl "0.2.11"]
                       [org.clojure/tools.namespace "0.2.11"]]

        :injections [(use 'clojure.stacktrace)
                     (require 'pjstadig.humane-test-output)
                     (pjstadig.humane-test-output/activate!)]}}
weavejester commented 9 years ago

Your problem is your (use 'clojure.stacktrace) injection. Both clojure.stacktrace and clojure.repl have a function called root-cause, so you can't refer to both in the same namespace. That's why it's failing for you.

ibawt commented 9 years ago

ok thx