【问题标题】:Clojure, fresh install: Unable to resolve symbol: some->Clojure,全新安装:无法解析符号:一些->
【发布时间】:2016-01-06 05:55:14
【问题描述】:

我刚刚安装了最新版本的 Clojure,在按照 Liberator (http://clojure-liberator.github.io/liberator/tutorial/getting-started.html) 的教程进行操作时,出现以下异常:

Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: some-> in this context, compiling:(clout/core.clj:88)
at clojure.lang.Compiler.analyze(Compiler.java:6281)
at clojure.lang.Compiler.analyze(Compiler.java:6223)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3497)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6457)
at clojure.lang.Compiler.analyze(Compiler.java:6262)
... ...
Caused by: java.lang.RuntimeException: Unable to resolve symbol: some-> in this context
at clojure.lang.Util.runtimeException(Util.java:170)
at clojure.lang.Compiler.resolveIn(Compiler.java:6766)
at clojure.lang.Compiler.resolve(Compiler.java:6710)
at clojure.lang.Compiler.analyzeSymbol(Compiler.java:6671)
at clojure.lang.Compiler.analyze(Compiler.java:6244)
... 114 more
Tests failed.

我使用的是 Ubuntu 15.04。莱宁根版本 2.5.3。 Java 版本 1.7.0_91。

Lein Repl 工作得很好,虽然它理解 (some ...),但它无法解析 (some-> ...)

我已经搜索了几个小时,看起来 some-> 应该是 Clojure v1.5+ 的标准函数

为什么我没有?

【问题讨论】:

  • 你显然有一些旧版本的 Clojure。你是在一个项目中运行你的 REPL 吗?愿意提供其project.clj
  • 另外,启动 REPL 时,打印的版本是什么?
  • 你们走在正确的轨道上,我的 REPL 版本是 1.7,但我的 project.clj(从教程复制)要求 v1.4。我将其更改为 1.7,现在可以使用了!

标签: clojure leiningen liberator


【解决方案1】:

从教程链接来看,project.clj 是:

(defproject liberator-tutorial "0.1.0-SNAPSHOT"
  :plugins [[lein-ring "0.8.11"]]
  :ring {:handler liberator-tutorial.core/handler}
  :dependencies [[org.clojure/clojure "1.4.0"] ;; <-!!!!!!!!!!!!!!!!
                 [liberator "0.13"]
                 [compojure "1.3.4"]
                 [ring/ring-core "1.2.1"]])

所以您使用 Clojure 1.4.0 运行。尝试将其更改为 1.7.0 左右。

【讨论】:

  • 感谢您发现这一点,您救了我!我将该字符串更改为"1.7.0",它运行良好!
猜你喜欢
  • 2019-09-05
  • 1970-01-01
  • 1970-01-01
  • 2021-05-30
  • 1970-01-01
  • 2014-12-25
  • 2012-07-15
  • 1970-01-01
  • 2022-08-18
相关资源
最近更新 更多