How to upgrade leiningen nrepl version?

I use leiningen and emacs + cider to develop clojure. A few days ago, after updating cider via emacs package manager, I get the following warning message when I run Mx cider-connect or 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> 

The warning message clearly states that I need to upgrade nrepl to 0.2.7, however I do not know how to do this.

I installed leiningen via brew and it uses 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=> 

Profile Content leiningen:

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

Question:: How to update the version of nrepl used by leiningen?

+43
emacs clojure leiningen
Feb 24 '15 at 5:25
source share
4 answers

I had this problem and solved it by adding an explicit dependency on the newer version of tools.nrepl to profiles.clj . My ~/.lein/profiles.clj :

 {:repl {:plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]] :dependencies [[org.clojure/tools.nrepl "0.2.7"]]}} 

I do not know the best or official way to do this.

+55
Feb 24 '15 at 6:00
source share

extra note at the top of @ matthew-moss's: the tools.nrepl dependency line is only used if you run lein repl from the clojure project. if you just run lein repl from your home directory, for example, you end up using the version of tools.nrepl that is compiled into leiningen. I do not know why.

Hope someone save time.

+8
May 09 '15 at 11:24
source share

lein has an update command, so in the simplest case

 lein upgrade 

If you installed leiningen with a package manager, you may need to do something like below (example for OS X, Linux distributions have their own wonderful package managers):

 brew unlink leiningen brew update brew install leiningen 
+5
Sep 30 '15 at 19:18
source share

As a complement to the accepted answer: adding a dependency on 0.2.7 in user profiles .clj worked for me a few days ago, but then I returned to warning 0.2.6 again. The query "lein deps: tree" had this line:

 [org.clojure/tools.nrepl "0.2.7" :scope "test" :exclusions [[org.clojure/clojure]]] 

Which made me realize that probably the lein-test-refresh plugin (defined in the same profile.clj) is causing some confusion here. Something More About Profiles I learned about the ^: replace hint. This dependency line now works for me:

 ^:replace [org.clojure/tools.nrepl "0.2.7"] 
+3
Apr 6 '15 at 17:32
source share



All Articles