I’m trying to get Cider to work on my laptop running OSX and failing. This makes me unhappy because I managed to do it on a Windows machine with lots of Cygwin so I felt that getting it to work on a Mac should be a breeze.
Basically, what I have set up my little project using
lein and can run it from the command line and from eshell, and I use Clojure Mode, but when I run
M-x cider-jack-in I see is this in my
Starting nREPL server via /Users/alex/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.15.0-SNAPSHOT\"\] -- repl :headless... Mark set nREPL server started on 53929 [nREPL] Establishing direct connection to localhost:53929 ... error in process filter: nrepl--direct-connect: [nREPL] Direct connection failed error in process filter: [nREPL] Direct connection failed
But now I have three buffers named
*nrepl-server ... with contents such as
nREPL server started on port 53872 on host 127.0.0.1 - nrepl://127.0.0.1:53872.
This reminds me... My Mac keeps deleting my
/etc/hosts file which means that
localhost is borked:
$ ping localhost ping: cannot resolve localhost: Unknown host
So I added it back to
Then I killed the three nrepl-server buffers and tried
C-c M-j again.
And it works. Phew!
Sometimes writing these posts just helps me focus as I’m troubleshooting.