macosclojureleiningen

OSX Leiningen permissions error


I installed Leiningen but when I run lein repl I get this error:

java.io.IOException: Permission denied. Please check your access rights for /Users/ethanraymond/.lein/repl-port at leiningen.repl$repl.doInvoke (repl.clj:305)
    clojure.lang.RestFn.invoke (RestFn.java:425)
    leiningen.repl$repl.invoke (repl.clj:295)
    clojure.lang.Var.invoke (Var.java:379)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:626)
    leiningen.core.main$partial_task$fn__6094.doInvoke (main.clj:263)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:626)
    leiningen.core.main$apply_task.invoke (main.clj:313)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:319)
    leiningen.core.main$_main$fn__6160.invoke (main.clj:392)
    leiningen.core.main$_main.doInvoke (main.clj:385)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.lang.Var.invoke (Var.java:379)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:624)
    clojure.main$main_opt.invoke (main.clj:315)
    clojure.main$main.doInvoke (main.clj:420)
    clojure.lang.RestFn.invoke (RestFn.java:436)
    clojure.lang.Var.invoke (Var.java:388)
    clojure.lang.AFn.applyToHelper (AFn.java:160)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.main.main (main.java:37)

The only answer I found was to remove Leiningen and reinstall it which didn't work.


Solution

  • Make sure the directory ~/.lein is owned by you by running ls -ld .lein, not by root. If it is not, then run sudo chown -R <user> ~/.lein.