Reputation: 67
I am using cider and leiningen for Clojure projects. But I am unable to add dependencies, or any library for the matter in a project after creation. But when I create a new project and add the same libraries, I don't see any errors then. Is this a bug or am I doing something wrong?
Walkthrough the problem:
1. lein new projectname
2. adding required libraries in project.clj and then lein deps
3. now write code in src/projectname/core.clj using the added libraries; works fine.
4. I forgot to add one more library; so back to step 2; done. Then step 3; failed!
5. Now make new project lein new projectname2
6. adding all the libraries which I required in projectname in project.clj
7. now write code in src/projectname2/core.clj using the added libraries; works fine.
Upvotes: 1
Views: 264
Reputation: 10865
In emacs cider for changes to the project.clj to take effect, you need to restart the session.
The most straightforward is to quit and reconnect:
M-x cider-quit
M-x cider-jack-in-clj
Or the equivalent short cuts, which for me would be C-c C-q C-c M-j
You can also do a restart, but note that it has to be a "hard" restart (good info on that here: https://metaredux.com/posts/2019/11/07/hard-cider-hard-restart.html)
M-x sesman-restart
Or (for me, at least) C-c C-s r
Hence:
adding required libraries in project.clj and then lein deps
2a. If you're currently in a cider session, restart it
Write code in src/projectname/core.clj using the added libraries; works fine.
Upvotes: 2