Can't get nrepl working in Emacs

I'm running on an Ubuntu machine. I had emacs23 installed, but it looks like nREPL is designed to work with emacs24 . So, I uninstalled emacs23 , installed emacs24 . I removed my existing .emacs file and .emacs.d directory.

Then I ran Mx package-list-packages and installed clojure-mode and nrepl .

I created a Clojure project with lein new foobar and then tried to open the default core.clj file. It puts me in Clojure mode automatically, but if I type Mx nrepl-jack-in (while in the core.clj buffer), it says Starting nREPL server... , but I never see any buffer named *nrepl* (which, based on reading the documentation, is the expected result). I just see the Starting nREPL server... in the minibuffer indefinitely.

Now, a buffer named *nrepl-server* is created and it says:

REPL started; server listening on localhost port 5871
Exception Unsupported option(s) supplied: :headless  clojure.core/load-libs (core.clj:5266)
clojure.core=>

But it doesn't seem like this is very useful (I can't seem to cause it to eval anything in that buffer?!?).

I tried Googling on this, but I couldn't find anybody who seemed to have this problem. I'd like to play around with Clojure (and core.logic in particular), but this is a complete non-starter. :-(


So, it turns out the issue was that my version of Ubuntu installed Leinengen 1.7.1 via apt-get but if I upgrade to version 2, the issue went away.

In summary, the issue is that lein version 2+ is required here but if you have a lower version you really don't get any visible indication of what is wrong (unless you count the exception thrown in *nrepl-server* , which isn't normally visible).


Next time you can also try to start the nrepl-server via lein repl in a separate shell. This way you can see if and on what port nrepl is running. In Emacs you can then do Mx nrepl and connect to the right nrepl server instance.

链接地址: http://www.djcxy.com/p/38610.html

上一篇: 新的luminus项目中的nrepl版本

下一篇: 无法在Emacs中获得nrepl的工作