Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't launch `lein` REPL in Emacs

In Emacs, when using clojure-mode, I ought to be able to launch a REPL with C-c C-z. Whenever I try, though, I get the error:

Searching for program: no such file or directory: lein

I have lein installed in /usr/local/bin (via brew) and /usr/local/bin is in my PATH (even Emacs says so, via eval-expression (getenv "PATH")).

What am I missing?

like image 969
jemmons Avatar asked Dec 02 '12 17:12

jemmons


1 Answers

Ah! The PATH environment variable isn't the end-all and be-all of emacs search paths. There's also the "exec-path". It apparently does mostly the same thing but not exactly.

Anyway, adding:

(add-to-list 'exec-path "/usr/local/bin")

To my .emacs.d/init.el (or .emacs if that's how you roll) cleared things up for me. The doc linked above suggests something a little more comprehensive, like:

(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
(setq exec-path (append exec-path '("/usr/local/bin")))

I'd try the (simpler) add-to-list, first. But YMMV.

like image 151
jemmons Avatar answered Oct 17 '22 21:10

jemmons