Uninstall/Reinstall leiningen(clojure server) rela

2019-02-16 09:58发布

问题:

As I asked and answered here, I found that running 'sudo lein deps causes some problem that forces me to run 'sudo lein swank', which is annoying. And I was told not to use sudo. I use Mac OS X 10.6.4.

So, I'll try to uninstall and reinstall leiningen.

Uninstalling leiningen

  • Removing ~/.m2 directory is just uninstall, is this correct?

(Re)installing leiningen

I followed the steps explained here.

  1. copy the 'lein' to ~/bin/lein and make it runnable.
  2. Run 'lein self-install', and I see ~/.m2/repository is installed.
  3. download leiningen using 'http://github.com/technomancy/leiningen.git' to ~/bin/leinigen

    • At this stage, I can't run 'lein help', but 'sudo lein help'. What's wrong with this?
  4. As a result, I can't run 'lein deps', but 'sudo lein deps, and the problem becomes recursive one.

Questions

  • Q : How to uninstall perfectly with leiningen?
  • Q : Why using 'sudo' makes lein correctly?

回答1:

yes removing .m2 and then lein self-install should fix this :)

when you can sudo lein ... it created files in .m2 owned by root so removing these and then recreating them as the proper user (you) should fix it. you could perhaps also just change the user on them back to yourself.

chown username:users ~/.m2/*