Fork me on GitHub
#practicalli
<
2023-03-11
>
Marc Andreu Fernandez12:03:53

Hello John, I hope you are doing well. First of all, many thanks for your online content; it really helps to study :-) Excuse me if this is not the right channel to ask about my issue. I'm just asking here because I have a problem with one of your github repositories. I did fork and clone your repository https://github.com/practicalli/four-clojure . I wanted to start experimenting with the 4clojure exercise within the REPL. That is a very useful idea to really practice and learn. I have just forked and opened one of the Clojure exercies and tried to connect the cider-jack-in-clj. I have got this error: "error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Execution error (FileNotFoundException) at http://java.io.FileInputStream/open0 (FileInputStream.java:-2). -Sdeps (No such file or directory)". I have read those Github issues https://github.com/clojure-emacs/cider/issues/2916, https://github.com/clojure-emacs/cider/issues/2922 and https://github.com/clojure-emacs/cider/issues/2941 . As I am new to Clojure and Spacemacs I did not find a solution to this problem. I see that have long passed since all those issues and things might have evolved. In one issue, you also commented, "I am no longer using cider-jack-in with Clojure CLI tools so will close this issue" and I am even more confused about how to run the exercises :-) What do you recommend me to do to be able to run the clojure code of your repo in a REPL. What would be the correct way to fix the repo, my configuration, java version, etc.? I have attached screenshots of the issue and my clojure environment. Many thanks in advance; any tip would be indeed appreciated. 🙂

practicalli-johnny13:03:22

First though is that its the alias in the .dir-locals.el file. The cider-clojure-cli-global-options variable is depreated and it should be cider-clojure-cli-aliases Using the older variable may be breaking the cider-jack-in command. I will push an update to the repository to fix the .dir-locals.el

practicalli-johnny13:03:41

For reference, there is more information about configuration Cider for a project here: https://practical.li/spacemacs/clojure-development/project-configuration/

practicalli-johnny13:03:19

EDIT: not needed, I've reproduced the issue Can you share the command that the Cider is using when calling cider-jack-in. The command will be in the *messages* buffer (`SPC b m` in Spacemacs)

practicalli-johnny13:03:00

Or use SPC u before the cider jack-in command to see the full command line before executing it (it can also be edited)

practicalli-johnny13:03:15

I can confirm that its the old cider variable name in the .dir-locals.el file that is causing the issue. I have pushed a couple of commits that update the cider variable and the alias name. Or you could delete the .dir-locals.el file as it is not needed for this specific project The :env/testalias included in .dir-locals.el is from the https://practical.li/clojure/clojure-cli/practicalli-config/, so if that is not installed then there will be a warning about the alias not found, although this warning can be ignored as I didnt write any unit tests in the 4clojure project. Te :env/test alias adds test directory as an :extra-paths so cider test runner can find code under the test directory (but in this case no such code exists)

practicalli-johnny13:03:42

For simple and very standard projects, then cider-jack-in is a convenient way to start a REPL process from Emacs I often use a https://practical.li/clojure/clojure-cli/repl-reloaded/ with commercial projects so start the REPL process from the command line and include a number of supporting tools. This also means the REPL keeps running if I shut down the editor (or I want to use a different editor) This approach is something that is not required when first learning with Clojure though

practicalli-johnny14:03:40

I've added notes to the issue discussions included in the question to inform that cider-clojure-cli-aliases variable is the correct way to add aliases to cider-jack-in. If you have any more issues or questions about Practicalli content and examples, dont hesitate to ask (there are no silly questions)

Marc Andreu Fernandez03:03:33

Wow, many thanks, John. It is a pleasure learning Clojure with your content and help. I will reply later when I have tried your fix. Many thanks 🙂

practicalli-johnny06:03:35

I found a few other projects with the older variable, so your inquiry has helped me fix those too. Thank you.

🙌 2
Marc Andreu Fernandez01:03:08

I, John, your fix worked perfectly. Many thanks 🙂

👍 2
Marc Andreu Fernandez03:03:33
replied to a thread:Hello John, I hope you are doing well. First of all, many thanks for your online content; it really helps to study :-) Excuse me if this is not the right channel to ask about my issue. I'm just asking here because I have a problem with one of your github repositories. I did fork and clone your repository https://github.com/practicalli/four-clojure . I wanted to start experimenting with the 4clojure exercise within the REPL. That is a very useful idea to really practice and learn. I have just forked and opened one of the Clojure exercies and tried to connect the cider-jack-in-clj. I have got this error: "error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Execution error (FileNotFoundException) at http://java.io.FileInputStream/open0 (FileInputStream.java:-2). -Sdeps (No such file or directory)". I have read those Github issues https://github.com/clojure-emacs/cider/issues/2916, https://github.com/clojure-emacs/cider/issues/2922 and https://github.com/clojure-emacs/cider/issues/2941 . As I am new to Clojure and Spacemacs I did not find a solution to this problem. I see that have long passed since all those issues and things might have evolved. In one issue, you also commented, "I am no longer using cider-jack-in with Clojure CLI tools so will close this issue" and I am even more confused about how to run the exercises :-) What do you recommend me to do to be able to run the clojure code of your repo in a REPL. What would be the correct way to fix the repo, my configuration, java version, etc.? I have attached screenshots of the issue and my clojure environment. Many thanks in advance; any tip would be indeed appreciated. :slightly_smiling_face:

Wow, many thanks, John. It is a pleasure learning Clojure with your content and help. I will reply later when I have tried your fix. Many thanks 🙂