clojure: profiles.clj not getting honored in some projects when using cider
Asked Answered
Y

2

3

I'm facing the same issue that is mentioned in the last comment in https://mcmap.net/q/621213/-installation-of-cider-nrepl (by Yu Shen)

I don't know why adding :plugins [[cider/cider-nrepl "0.7.0"]] at ~/.lein/profiles.clj does not work. But the same expression: :plugins [[cider/cider-nrepl "0.7.0"]] at the project.clj of my project worked as expected.

Till now i thought that all my projects were behaving this way, but today i found something different. Maybe a hint to what is going wrong? The 2 projects that behave differently have the following structure:

==================== project-1/project.clj (cider does not work) ====================

(defproject clj "0.1.0-SNAPSHOT"
  :description "Frontend for stox@gryffin"
  :url "http://stox.gryff.in/"
  :dependencies [[selmer "0.6.9"]
                 [clj-time "0.6.0"]
                 [http-kit "2.1.18"]
                 [com.taoensso/timbre "3.2.1"]
                 [noir-exception "0.2.2"]
                 [im.chit/cronj "1.4.3"]
                 [environ "1.0.0"]
                 [org.clojure/tools.nrepl "0.2.3"]
                 [clojure-complete "0.2.4"]
                 [org.clojure/clojure "1.6.0"]
                 [org.clojure/data.json "0.2.5"]
                 [ring-server "0.3.1"]
                 [com.taoensso/tower "2.0.2"]
                 [com.novemberain/monger "2.0.0"]
                 [org.clojure/math.numeric-tower "0.0.4"]
                 [lib-noir "0.8.4"]]
  :jvm-opts ["-Xmx512m" "-Xms128m"]
  :plugins [[lein-environ "1.0.0"]]
  :main clj.core)

==================== project-2/project.clj (cider works) ====================

(defproject project-euler "0.1.0-SNAPSHOT"
  :description "Solve problems on project-euler website"
  :url "http://projecteuler.net/problems"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/core.memoize "0.5.6"]
                 [expectations "2.0.13"]
                 [org.clojure/math.numeric-tower "0.0.4"]
                 [org.clojure/math.combinatorics "0.0.8"]
                 [criterium "0.4.3"]
                 [org.clojure/tools.trace "0.7.8"]
                 [com.taoensso/timbre "3.2.1"]]
  :plugins [[lein-autoexpect "1.0"]])

==================== ~/.lein/profiles.clj ====================

{:user {:plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]]}}

EDIT: 1. error message seen in cider for project-1

; CIDER 0.9.0alpha (package: 20150114.512) (Java 1.7.0_55, Clojure 1.6.0, nREPL 0.2.6)
WARNING: The following required nREPL ops are not supported: 
apropos classpath complete eldoc info inspect-start inspect-refresh inspect-pop inspect-push inspect-reset macroexpand ns-list ns-vars resource stacktrace toggle-trace-var toggle-trace-ns undef
Please, install (or update) cider-nrepl 0.9.0-SNAPSHOT and restart CIDER
WARNING: CIDER's version (0.9.0-snapshot) does not match cider-nrepl's version (not installed)
  1. (snipped) lein deps :tree

    warn [cider/cider-nrepl "0.9.0-20150118.121230-2"] [cljs-tooling "0.1.3" :exclusions [[org.clojure/clojure]]] [compliment "0.2.1-20141130.115631-1" :exclusions [[org.clojure/clojure]]] [defprecated "0.1.1"] [org.clojure/java.classpath "0.2.0" :exclusions [[org.clojure/clojure]]] [org.clojure/tools.trace "0.7.8" :exclusions [[org.clojure/clojure]]] [org.tcrawley/dynapath "0.2.3" :exclusions [[org.clojure/clojure]]]

Yorke answered 26/1, 2015 at 11:41 Comment(5)
Have you tried lein deps :tree? Also, I'd tried with a release version of cider to see if it reproducible. Finally, how do you know profiles.clj is not being honoured?Gendron
What version of lein? Have you updated your emacs packages (assuming your using melba). It is important the emacs sider package and the lein cider nrepl versions are in sync. I've only seen that message when they are not.Anagoge
@TimX : 1. "Leiningen 2.5.0 on Java 1.7.0_55 OpenJDK 64-Bit Server VM". 2. version of cider "cider-20150114.512" which corresponds to "cider-nrepl 0.9.0-SNAPSHOT"Yorke
There is a new Klein version 2.5.1, released just a few days ago. Suggest you update to that to begin with. Not sure how to resolve your issue further. I'm using the same version on a Linux box with no problems. Just noted there is a new cider-20150126.1253. All I can suggest is start with a minimal config and start adding back things, checking after each change and see if that helps narrow down the cause.Anagoge
I realized that my problem was that I mistook the directory for profiles.clj in Windows. It's not at ~/.lein but at C:\Users\<user_id_in_windows>\.lein\profiles.clj once I put the customization at the right directory, it works as expected. No more problem.Ceolaceorl
L
1
$ lein version
Leiningen 2.5.1 on Java 1.8.0_25 OpenJDK 64-Bit Server VM

My ~/.lein/profiles.clj:

{:user {:plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]]
        :dependencies [[org.clojure/tools.nrepl "0.2.7"]]}}

(exactly as https://mcmap.net/q/671239/-how-to-change-clojure-or-lein-39-s-clojure-default-version suggests)

Running lein repl in an empty directory:

$ lein repl
nREPL server started on port 40595 on host 127.0.0.1 - nrepl://127.0.0.1:40595
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.6.0
OpenJDK 64-Bit Server VM 1.8.0_25-b18
Docs: (doc function-name-here)

after creating a project with lein new app; cd app

$ lein repl
Retrieving org/clojure/clojure/1.6.0/clojure-1.6.0.jar from central
nREPL server started on port 55421 on host 127.0.0.1 - nrepl://127.0.0.1:55421
REPL-y 0.3.5, nREPL 0.2.7
Clojure 1.6.0

I am inclined to believe this might be a manifestation of some bug i Leiningen, but I am not sure... (why is it downloading clojure?)

Laic answered 8/3, 2015 at 17:56 Comment(0)
M
0

UPDATED MAY/2021

Change your ~/.lein/profiles.clj file to the following:

{:user {:plugins [[cider/cider-nrepl "0.26.0-SNAPSHOT"]]
        :dependencies [[nrepl "0.8.3"]]}}

Dependency specification for nrepl is referenced from cider-nrepl Clojars page.

Mnemosyne answered 9/5, 2021 at 15:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.