我想学习Clojure并且我已经下载并设置了以下小玩意:
我已经开始工作了。现在我尝试打印消息"Hello, World!"
,同时在Emacs中运行Cider:
; CIDER 0.6.0 (Java 1.7.0_65, Clojure 1.6.0, nREPL 0.2.0-beta5)
user> (println "Hello World!")
Hello World!NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I
clojure.tools.nrepl.middleware.session/session-out/fn--7630
(session.clj:43)NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I
clojure.tools.nrepl.middleware.session/session-out/fn--7630 (session.clj:43)
user>
这是什么声音?当我跑步时:
$ clojure
;Clojure 1.6.0
user=> (println "Hello, World!")
Hello, World!
nil
一切都很好。当我和Leiningen一起做的时候:
$ lein repl
; lotsa stuff here...
user=> (println "Hello, World!")
输入此命令后,我津津乐道以下诗歌:
CompilerException java.lang.RuntimeException: Unable to resolve symbol: rprintln in this context, compiling:(NO_SOURCE_PATH:1:1) NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I clojure.tools.nrepl.middleware.session/session-out/fn--7630 (session.clj:43)
Exception in thread "nREPL-worker-3" java.lang.NoSuchMethodError: clojure.tools.nrepl.StdOutBuffer.length()I
at clojure.tools.nrepl.middleware.session$session_out$fn__7630.doInvoke(session.clj:43)
at clojure.lang.RestFn.invoke(RestFn.java:460)
at clojure.tools.nrepl.middleware.session.proxy$java.io.Writer$ff19274a.write(Unknown Source)
at java.io.PrintWriter.write(PrintWriter.java:456)
at java.io.PrintWriter.write(PrintWriter.java:473)
at clojure.core$fn__5471.invoke(core_print.clj:191)
at clojure.lang.MultiFn.invoke(MultiFn.java:231)
at clojure.core$pr_on.invoke(core.clj:3392)
at clojure.core$pr.invoke(core.clj:3404)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$prn.doInvoke(core.clj:3437)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$println.doInvoke(core.clj:3457)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.main$repl_caught.invoke(main.clj:158)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569$fn__7582.invoke(interruptible_eval.clj:76)
at clojure.main$repl$fn__6634.invoke(main.clj:259)
at clojure.main$repl.doInvoke(main.clj:257)
at clojure.lang.RestFn.invoke(RestFn.java:1096)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569.invoke(interruptible_eval.clj:56)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:41)
at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__7610$fn__7613.invoke(interruptible_eval.clj:171)
at clojure.core$comp$fn__4192.invoke(core.clj:2402)
at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__7603.invoke(interruptible_eval.clj:138)
at clojure.lang.AFn.run(AFn.java:22)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
哦,Nooo。太痛苦了!停下来,停下来!
我很困惑。它是什么,我该如何解决这个问题?有没有类似的经历?如何在Clojure中打印"Hello, World!"
?
答案 0 :(得分:5)
我可以用leinengen 2.4.3重现这个错误。您可以运行lein upgrade 2.4.2
以获取实际可用的最新版本。 leiningen团队将这样的糟糕构造标记为稳定是不寻常的,起初我怀疑是苹果酒。顺便说一句,苹果酒的“稳定”版本应为0.7.0。