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 (:~ $
If you are seeing this error in Linux, you may need to set your PATH in ~/.bash_profile instead of ~/.bashrc when running emacs from the menu instead of the shell.
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).
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
I had to do this:
;; set the path as terminal path [http://lists.gnu.org/archive/html/help-gnu-emacs/2011-10/msg00237.html]
(setq explicit-bash-args (list "--login" "-i"))
;; fix the PATH variable for GUI [http://clojure-doc.org/articles/tutorials/emacs.html#osx]
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell
(shell-command-to-string "$SHELL -i -l -c 'echo $PATH'")))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(when window-system (set-exec-path-from-shell-PATH))