Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OSX, Emacs 24.2 and nrepl.el not working

I'm using nrepl.el, Emacs 24.2. My S.O version is OS X Lion 10.7.5.

Running the command [M-x] nrepl after start a REPL session through lein (:~ $ lein repl) i am able to connect to it but if i try to use [M-x] nrepl-jack-in i get the message bellow:

error in process sentinel: Could not start nREPL server: /bin/bash: lein: command not found

I installed leiningen using the instructions in the main site and reinstalled it using homebrew with the command brew install leiningen --devel but both methods give me the same error.

Adding the path /usr/loca/bin to emacs exec-path list or trying to configure nrepl.el variable nrepl-lein-command to point to the full path of my lein installation does not help.

My emacs configuration can be found here: https://github.com/khaoz/emacs-files

What i'm doing wrong ?

Thanks :)

like image 953
Giuliani Sanches Avatar asked Nov 06 '12 01:11

Giuliani Sanches


2 Answers

While @Arthur is correct a much simpler solution to your problem would be to install the exec-path-from-shell Emacs extension. It will copy your shell PATH (and MANPATH) to Emacs automatically and fairly reliably. This means that the PATH would be correct no matter where you started Emacs from (spotlight included).

like image 187
Bozhidar Batsov Avatar answered Sep 29 '22 21:09

Bozhidar Batsov


for those of you landing on this question who are using a Mac:

lein needs to be on the path as seen by Emacs. This can be done by starting Emacs from bash

/Applications/Emacs.app/Contents/MacOS/Emacs project.clj

then: M-x nrepl-jack-in

If this solves the problem you can configure emacs to use the correct path by following these instructions

like image 41
Arthur Ulfeldt Avatar answered Sep 29 '22 20:09

Arthur Ulfeldt