nta*_*lbs 44 emacs clojure leiningen
我正在使用leiningen和emacs+ cider用于clojure开发.几天前,在我cider通过emacs包管理器升级后,当我运行M-x cider-connect或运行时,我收到以下警告消息M-x cider-jack-in.
; CIDER 0.9.0snapshot (package: 20150222.137) (Java 1.8.0_31, Clojure 1.6.0, nREPL 0.2.6)
WARNING: CIDER requires nREPL 0.2.7 to work properly
user>
Run Code Online (Sandbox Code Playgroud)
警告信息明确表示我必须将nrepl升级到0.2.7,但是,我不知道如何.
我安装了leiningenvia brew,它使用了nrepl 0.2.6.
$ lein repl
nREPL server started on port 53218 on host 127.0.0.1 - nrepl://127.0.0.1:53218
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.6.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_31-b13
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=>
Run Code Online (Sandbox Code Playgroud)
leiningen简介的内容是:
{:user {:plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]]}}
Run Code Online (Sandbox Code Playgroud)
问题:如何升级leiningen使用的nrepl版本?
小智 57
我刚刚遇到这个问题,我通过在较新版本的tools.nreplto 上添加显式依赖来解决它profiles.clj.我的~/.lein/profiles.clj:
{:repl {:plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]]
:dependencies [[org.clojure/tools.nrepl "0.2.7"]]}}
Run Code Online (Sandbox Code Playgroud)
不知道这是最好的还是官方的方式来做到这一点.
@ matthew-moss之上的另一个注释:仅当你lein repl在一个clojure项目中运行时,才使用tools.nrepl依赖项.lein repl例如,如果你只是从你的主目录运行,你最终会使用编译成leiningen的tools.nrepl版本.不知道为什么.
希望节省一些时间.
lein有一个升级命令,所以在最简单的情况下
lein upgrade
Run Code Online (Sandbox Code Playgroud)
如果您使用软件包管理器安装leiningen,您可能需要执行类似下面的操作(OS X的示例,Linux发行版有他们自己的精彩软件包管理器):
brew unlink leiningen
brew update
brew install leiningen
Run Code Online (Sandbox Code Playgroud)