The ‘CIDER requires nREPL 0.2.7’ Mystery

For my Clojure developments I’m using Emacs 24.4 (running on a Mac) with a cider 0.9.0snapshot, Clojure 1.6.0 and nREPL 0.2.7. Actually. When I’m starting emacs in my home directory and open a repl with M-x cider-jack-in, then I’m getting this warning:

cider requires nrepl 0.2.7 (or newer)

cider requires nrepl 0.2.7 (or newer)

WARNING: CIDER requires nREPL 0.2.7 (or newer) to work properly – definitely not what I want to see. But when I load a .clj within a project beforehand, the repl starts up without that warning:

cider starting without problems

cider starting without problems

What’s happening here? My profiles.clj is as easy as can be:

I think this issue is related to the one discussed here (“CIDER erroneously complaining about cider-nrepl version“). Batsov states that “the current stable lein pulls in 0.2.6” (a bug), but I’ve upgraded leiningen to 2.5.1 and this erroneous behaviour still happens. Is the cause really related to leiningen only?

I observed the disk i/o during cider’s startup phase. Emacs starts up leiningen which opens up a new shell process. After that, leiningen tries to load clj files on various standard paths:

2981 Emacs-x86_64-10 stat /usr/local/bin/lein
2981 Emacs-x86_64-10 stat /bin/tcsh
3006 java stat /Users/mberndtgen/.lein
3006 java stat /Users/mberndtgen/.lein/profiles.clj
3006 java open FL=0x0,MODE=0x1B6,/Users/mberndtgen/.lein/profiles.clj
3006 java stat /Users/mberndtgen/.lein
3006 java stat /Users/mberndtgen/.lein/profiles.d
3006 java stat target/stale/extract-native.dependencies
3006 java stat /Users/mberndtgen/%s/classes
3006 java stat /Users/mberndtgen/%s/classes
3006 java stat /etc/leiningen/profiles.clj
3006 java stat profiles.clj
3006 java stat /Users/mberndtgen/.m2/repository/cider/cider-nrepl/0.9.0-SNAPSHOT/maven-metadata-local.xml

The only existing profiles.clj is that in ~/.lein/ (see above). Leiningen tries to load other .clj’s (profiles, project, init) from other places as well, but the only reference to nreply is given in that one and only ~/.lein/profiles.clj. There’s no reference to nrepl 0.2.6 at all, at least not in my home directory and below.

So: where does this reference come from? What’s producing this peculiar error that didn’t occur till last week, when I’ve updated cider and other emacs packages?

(I first called this article “21st Century Problems” which seemed a rather fitting title. Upgrading leiningen wasn’t without problems as well, because curl claimed about an outdated libssl. I hate it when problems are piling up.)

About Manfred Berndtgen

Manfred Berndtgen, maintainer of this site, is a part-time researcher with enough spare time for doing useless things and sharing them with the rest of the world. His main photographic subjects are made of plants or stones, and since he's learning Haskell everything seems functional to him.