Fork me on GitHub
#spacemacs
<
2021-02-16
>
ivar14:02:50

if I see WARNING: CIDER 1.1.0-snapshot requires cider-nrepl 0.25.9, but you're currently using cider-nrepl 0.21.1. The version mismatch might break some functionality! have I done something wrong, or did I catch my spacemacs dependenies in a weird state when I updated my packages? (I just refreshed develop and updated all my packages)

ivar15:02:37

hmm.. following up, I tried using the practicalli spacemacs config and it has the same error.

ivar16:02:52

ugh. I'm still new to this. I found the old version of cider-nrepl was specified in the project.clj

practicalli-johnny07:02:06

If you are using cider-jack-in to start the REPL, remove the cider-nrepl dependency from the project.clj. If using cider-connect then update the version of cider-nrepl in project.clj to match the version of Cider

👍 3
ivar22:02:42

Another newb question - how do I load environment variables into my repl ? I've got direnv setup in my shell, and a .envrc file at the root of my clojure project, but I'm stumped as to how to provide the env vars to the repl process. Any pointers appreciated.

practicalli-johnny07:02:40

(System/getenv "PORT")
This will read the value of the PORT environment variable

practicalli-johnny08:02:55

If you add an environment variable to you operating system with Emacs already running, you will need to restart before Emacs picks it up. If you are using Spacemacs develop them add the environment variable to spacemacs.env SPC f e e Then reload spacemacs.env (which I think is SPC f e E )

👀 3
ivar15:02:28

oooh. Interesting

ivar16:02:05

My use case is that I want the jvm started with cider-jack-in to have certain environment vars. For my shell I use direnv but I'm not sure what's the best way (or frankly any way) to get this to work in spacemacs. I see there's at least a couple of existing emacs plugins (https://github.com/purcell/envrc and https://github.com/wbolster/emacs-direnv) but I'm not comfortable enough with spacemacs (or emacs) to try creating my own layer. Am I missing existing functionality in spacemacs on how to use these env vars ? is it possible to set environment variables with .dir-locals.el that would be exposed to a repl process?

ivar16:02:15

in the short term, I guess I can swap out different versions of spacemacs.envand restart emacs when switching projects.. I didn't know about spacemacs.env - thank you!

practicalli-johnny17:02:36

I would probably create a spacemacs.env file for each set of environment variables, naming them something like spacemacs.env.appone, spacemacs.env.apptwo and create a symbolic link called spacemacs.env that links to which ever file has the ones I need. When changing apps, I'd recreate the symbolic link to point to the other file and run SPC f e E to load it.

ivar17:02:54

that seems viable, and is a step better than what I've got going.. thank you for your advice