Fork me on GitHub
#cider
<
2019-02-02
>
gisf21:02:48

Hello, I started with clojure and spacemacs yesterday and have created an simple project

lein new project_name
When i try run cider on core.clj a bunch of warnings come out and repl does’nt start. Can anyone help me?

dpsutton21:02:36

can you tell me your cider version and lein versions Gustavo?

dpsutton21:02:58

(and feel free to ask how to get those versions if you don't know)

gisf21:02:09

$ lein version
Warning: implicit middleware found: refactor-nrepl.plugin/middleware 
Please declare all middleware in :middleware as implicit loading is deprecated.
Warning: refactor-nrepl requires org.clojure/clojure 1.7.0 or greater.
Warning: refactor-nrepl middleware won't be activated due to missing dependencies.
Warning: implicit middleware found: cider-nrepl.plugin/middleware 
Please declare all middleware in :middleware as implicit loading is deprecated.
Leiningen 2.8.3 on Java 11.0.2 Java HotSpot(TM) 64-Bit Server VM

dpsutton21:02:08

ok. let's get rid of refactor-nrepl until we know we have a working env. I'm not sure of the state of refactor nrepl. There have been lots of changes and I'm not sure if the changes have been reflected there

dpsutton21:02:41

I'm also surprised as a warning needing 1.7.0 or greater. are you running an older clojure? I thought i saw 1.9 in there

gisf21:02:48

how can i see cider version?

gisf21:02:00

this i don’t know

dpsutton21:02:04

there's a function M-x cider-version

dpsutton21:02:12

but that looks like spacemacs so i'm not sure

dpsutton21:02:02

my suspicion is we have an old clojure somewhere and refactor-nrepl isn't playing nice

gisf21:02:22

CIDER 0.21.0snapshot

gisf21:02:39

My problem looks almost exactly like this. I can’t see clojure version because when i try, those errors come out https://github.com/clojure-emacs/cider-nrepl/issues/574

dpsutton22:02:00

you can run lein deps :tree and it will show you the dependencies involved. There's a change there's a clash between tools.nrepl and nrepl.nrepl. ( a recent low level migration that is unfortunately thorny due to how deep it is)

dpsutton22:02:39

another easy test might be to just lein new testapp and then try to jack into that. just to see if a clean project works and isolate this problem to dependencies in a certain project

gisf22:02:19

I read this tools.nrepl thing but not understand. I will do this right now

gisf22:02:13

Jarvis:/ gustavoisidio$ lein deps :tree
Warning: implicit middleware found: refactor-nrepl.plugin/middleware 
Please declare all middleware in :middleware as implicit loading is deprecated.
Warning: refactor-nrepl requires org.clojure/clojure 1.7.0 or greater.
Warning: refactor-nrepl middleware won't be activated due to missing dependencies.
Warning: implicit middleware found: cider-nrepl.plugin/middleware 
Please declare all middleware in :middleware as implicit loading is deprecated.
Couldn't find project.clj, which is needed for deps

dpsutton22:02:33

ah, are you starting this without a project?

gisf22:02:49

yes, by the terminal

dpsutton22:02:53

normally you are in a directory that has a project.clj file

gisf22:02:04

okay, will do this

dpsutton22:02:11

ok. run lein new testapp which should crank up a new skeleton app for you if you need

dpsutton22:02:17

or an existing one

gisf22:02:28

$ ls
CHANGELOG.md	README.md	project.clj	src
LICENSE		doc		resources	test
$ lein deps :tree
Warning: implicit middleware found: refactor-nrepl.plugin/middleware 
Please declare all middleware in :middleware as implicit loading is deprecated.
Warning: implicit middleware found: cider-nrepl.plugin/middleware 
Please declare all middleware in :middleware as implicit loading is deprecated.
 [cider/cider-nrepl "0.10.0-20151127.123841-44"]
   [org.tcrawley/dynapath "0.2.3" :exclusions [[org.clojure/clojure]]]
 [clojure-complete "0.2.5" :exclusions [[org.clojure/clojure]]]
 [nrepl "0.5.3" :exclusions [[org.clojure/clojure]]]
   [nrepl/bencode "1.0.0"]
 [org.clojure/clojure "1.9.0"]
   [org.clojure/core.specs.alpha "0.1.24"]
   [org.clojure/spec.alpha "0.1.143"]
 [org.clojure/tools.nrepl "0.2.12"]
 [refactor-nrepl "2.0.0-20160206.122040-20"]
`

dpsutton22:02:28

ok. there's some really wacky stuff going on here

dpsutton22:02:10

cider-nrepl should be version 20, not 10. Do you have a ~/profiles.clj by any chance in your home directory?

dpsutton22:02:36

also that tools.nrepl 0.2.12 is the old version and the nrepl "0.5.3" is the new version and they cannot peacefully coexist. we need to eradicate the tools.nrepl

gisf22:02:27

Yes, i have. It’s just change my profiles.clj?

gisf22:02:45

it should look like this?

gisf22:02:53

{:user {:plugins [[refactor-nrepl "2.4.0-SNAPSHOT"]
                  [cider/cider-nrepl "0.20.0-SNAPSHOT"]]
        :dependencies [[org.clojure/tools.nrepl "0.5.3"]]}}
`

dpsutton22:02:32

you should be able to leave all of that out. CIDER will inject it for you @gisf

gisf23:02:02

Thank you for saving my life

gisf23:02:28

Works perfectly

gisf23:02:31

So, this lines on profiles.clj was holding me in an old version of refactor, cider and tools right?

gisf23:02:10

This may be useful if the updated version of those three has some problems. I’am right? And what more this profiles.clj file is for?