Running Clojure on Emacs with `sider-jack-in`

I am trying to run Clojure emacs with the cider package installed. I am using Emacs 24.5.1 on Mac OS X 10.10.4.

I downloaded the lein script and copied the script to ~ / Dropbox / bin. I checked with lein repl that Clojure is working fine.

The cider package installs with the Mx package-install . I edited ~/.emacs.d/init.el to specify a lein script: (add-to-list 'exec-path "~/Dropbox/bin") with the hint Unable to start RELLLL in Emacs .

However, when I started emacs and ran Mx cider-jack-in , I have this error message:

enter image description here

When I launched lein repl and executed Mx cider-connect ( http://xahlee.info/clojure/clojure_emacs_cider.html ), I can run cider-repl in Emacs,

enter image description here

What could be wrong?

+4
source share
2 answers

Another simple solution is to just use homegrown. While the homegrown overflows only to set the lane, if you are already using it, then all you need to do is start

 brew update brew install leiningen 

and your business. I use homebrew to install emacs and some other useful applications, so I already have this on my system.

+1
source

The quickest fix was to symbolically associate lein with a path where Emacs can find it. This line of code fixed the problem.

 sudo ln -s ~/Dropbox/bin/lein /usr/local/bin/lein 

I outlined the steps for installing a cider package to run Clojure on emacs without any errors or warnings.

cider - https://github.com/clojure-emacs/cider

Installation

  • Download lein https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
    • I copied the file ~ / Dropbox / bin after executing it.
  • It seems that / usr / local / bin is not the way that Emacs automatically finds the binary, so I had to configure it.

    • Run sudo ln -s ~/Dropbox/bin/lein /usr/local/bin/lein
    • Update ~/.emacs.d/init.el to indicate the location of the lein script:
      • (add-to-list 'exec-path "/usr/local/bin")
  • Update ~/.lein/profiles.clj

Errors and solutions

  • If The lein executable (specified by cider-lein-command 'or cider-boot-command') isn't on your exec-path :

    • make a symlink and update init.el , as explained.
  • If the error "Character function definition is invalid: clojure -project-dir" is due to a package version mismatch.

Now all the warnings are gone.

enter image description here

References

Added

For Mac OS X brew install leiningen you can install lein, but this caused a problem, as in How to upgrade leiningen nrepl? . This is a message from Lane brew.

 nREPL server started on port 61216 on host 127.0.0.1 - nrepl://127.0.0.1:61216 REPL-y 0.3.5, nREPL 0.2.6 Clojure 1.6.0 Java HotSpot(TM) 64-Bit Server VM 1.8.0_45-b14 

I had to use the lane from the lein website to get the correct version of the tools.

 Retrieving org/clojure/clojure/1.2.0/clojure-1.2.0.pom from central nREPL server started on port 61279 on host 127.0.0.1 - nrepl://127.0.0.1:61279 REPL-y 0.3.7, nREPL 0.2.7 Clojure 1.7.0 
+15
source

All Articles