Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 M-x 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 M-x 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. :-(

like image 320
Michael Tiller Avatar asked Sep 10 '13 01:09

Michael Tiller


1 Answers

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).

like image 167
Michael Tiller Avatar answered Sep 28 '22 03:09

Michael Tiller