13

就在今天,我已经通过 el-get 安装了苹果酒。当我在 emacs 中启动 cider 时,会打印以下横幅:

; CIDER 0.8.0-snapshot (Java 1.7.0_65, Clojure 1.6.0, nREPL 0.2.6)
WARNING: The following required nREPL ops are not supported: 
eldoc ns-list ns-vars undef
Please, install (or update) cider-nrepl 0.8.0-snapshot and restart CIDER
WARNING: CIDER's version (0.8.0-snapshot) does not match cider-nrepl's version (0.7.0)
user> 

我可以在苹果酒中运行我的单元测试,但是很多其他的东西都不起作用,比如文档查找等。请注意,提示也在用户命名空间中,而不是在项目命名空间中。

我的 ~/.lein/profiles.clj

{:user 
 {:plugins 
  [[cider/cider-nrepl "0.7.0"]]}
}

我看到 lein 已经下载了所需的内容(然后是一些,奇怪的是):

$ find ~/.m2 -name "*nrepl*"
~/.m2/repository/cider/cider-nrepl
~/.m2/repository/cider/cider-nrepl/0.8.0-SNAPSHOT/cider-nrepl-0.8.0-20140914.152356-14.jar.sha1
~/.m2/repository/cider/cider-nrepl/0.8.0-SNAPSHOT/cider-nrepl-0.8.0-20140914.152356-14.pom
~/.m2/repository/cider/cider-nrepl/0.8.0-SNAPSHOT/cider-nrepl-0.8.0-20140914.152356-14.jar
~/.m2/repository/cider/cider-nrepl/0.8.0-SNAPSHOT/cider-nrepl-0.8.0-20140914.152356-14.pom.sha1
~/.m2/repository/cider/cider-nrepl/0.8.0-SNAPSHOT/cider-nrepl-0.8.0-SNAPSHOT.pom
~/.m2/repository/cider/cider-nrepl/0.8.0-SNAPSHOT/cider-nrepl-0.8.0-SNAPSHOT.jar
~/.m2/repository/cider/cider-nrepl/0.7.0/cider-nrepl-0.7.0.jar.sha1
~/.m2/repository/cider/cider-nrepl/0.7.0/cider-nrepl-0.7.0.pom.sha1
~/.m2/repository/cider/cider-nrepl/0.7.0/cider-nrepl-0.7.0.jar
~/.m2/repository/cider/cider-nrepl/0.7.0/cider-nrepl-0.7.0.pom
~/.m2/repository/org/clojure/tools.nrepl
~/.m2/repository/org/clojure/tools.nrepl/0.2.6/tools.nrepl-0.2.6.pom.sha1
~/.m2/repository/org/clojure/tools.nrepl/0.2.6/tools.nrepl-0.2.6.pom
~/.m2/repository/org/clojure/tools.nrepl/0.2.6/tools.nrepl-0.2.6.jar.sha1
~/.m2/repository/org/clojure/tools.nrepl/0.2.6/tools.nrepl-0.2.6.jar

我还看到 lein 想要同时引入 cider-nrepl 和 tools.nrepl,尽管我肯定不明白为什么:

$ lein deps :tree
warn
 [cider/cider-nrepl "0.7.0"]
   [cljs-tooling "0.1.3" :exclusions [[org.clojure/clojure]]]
   [compliment "0.1.3" :exclusions [[org.clojure/clojure]]]
   [org.clojure/java.classpath "0.2.0" :exclusions [[org.clojure/clojure]]]
   [org.clojure/tools.namespace "0.2.5" :exclusions [[org.clojure/clojure]]]
   [org.clojure/tools.trace "0.7.8" :exclusions [[org.clojure/clojure]]]
   [org.tcrawley/dynapath "0.2.3" :exclusions [[org.clojure/clojure]]]
 [clojure-complete "0.2.3" :scope "test" :exclusions [[org.clojure/clojure]]]
 [org.clojure/clojure "1.6.0"]
 [org.clojure/tools.nrepl "0.2.6" :scope "test" :exclusions [[org.clojure/clojure]]]

最后,我的 project.clj,尽管我在所有 clojure 项目中都看到了这个问题:

(defproject cider-demo "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]])

如何让苹果酒选择正确的 cider-nrepl?

4

1 回答 1

7

错误非常清楚地呈现:

WARNING: CIDER's version (0.8.0-snapshot) does not match cider-nrepl's version (0.7.0)

你需要改变你的profiles.clj依赖:

{:user 
 {:plugins 
  [[cider/cider-nrepl "0.8.0-SNAPSHOT"]]}
}

或者降级您的 emacs cider 版本以匹配cider-nrepl您当前要求的版本。

tools.nrepl在这里不是问题,此外,cider 如果没有 tools.nrepl 实际上就无法工作

于 2014-10-11T17:47:34.073 回答