[英]How to upgrade nrepl version of leiningen?
我正在使用leiningen
和emacs
+ cider
進行clojure開發。 幾天前,在我通過emacs包管理器升級cider
之后,當我運行Mx cider-connect
或Mx 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>
警告信息明確表示我必須將nrepl升級到0.2.7,但是,我不知道如何。
我通過brew
安裝leiningen
,它使用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=>
leiningen簡介的內容是:
{:user {:plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]]}}
問題:如何升級leiningen使用的nrepl版本?
我剛剛遇到這個問題,我通過在較新版本的tools.nrepl
對profiles.clj
的顯式依賴來解決它。 我的~/.lein/profiles.clj
:
{:repl {:plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]]
:dependencies [[org.clojure/tools.nrepl "0.2.7"]]}}
不知道這是最好的還是官方的方式來做到這一點。
@ matthew-moss之上的另一個注釋:只有在clojure項目中運行lein repl
時才使用tools.nrepl依賴行。 例如,如果你只是從你的主目錄運行lein repl
,你最終會使用編譯成leiningen的tools.nrepl版本。 不知道為什么。
希望節省一些時間。
lein有一個升級命令,所以在最簡單的情況下
lein upgrade
如果您使用軟件包管理器安裝leiningen,您可能需要執行類似下面的操作(OS X的示例,Linux發行版有他們自己的精彩軟件包管理器):
brew unlink leiningen
brew update
brew install leiningen
作為已接受答案的補充:在用戶profiles.clj中添加對0.2.7的依賴性幾天前為我工作但突然之后我又回到0.2.6警告。 問“lein deps:tree”有這條線:
[org.clojure/tools.nrepl "0.2.7" :scope "test" :exclusions [[org.clojure/clojure]]]
這給了我一個線索,可能是lein-test-refresh插件(在同一個profiles.clj中定義)引起了一些混亂。 閱讀更多關於我了解^:replace提示的配置文件 。 依賴關系中的這一行現在適用於我:
^:replace [org.clojure/tools.nrepl "0.2.7"]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.