Cider Issue?

201 views
Skip to first unread message

Alex Schroeder

unread,
Jul 17, 2015, 10:52:06 AM7/17/15
to emacs...@googlegroups.com
Hi all

I have used Emacs Live and Overtone once or twice and don't remember any issues. Today I pulled a new Emacs Live from git and – being such a newbie – trying to get everything to work again.

I followed the instructions about the repl from https://github.com/overtone/overtone and in my terminal, I can produce the demo sounds from that page.

Then I looked at https://github.com/overtone/emacs-live and noticed a few things.


1. It talks about using "lein2 repl" but apparently it works perfectly fine with just "lein repl". Perhaps a peculiarity of the distribution used – or maybe related to the error I'm seeing? Anyway, it seems to start just fine:

alex@Megabombus:~/src/insane-noises$ lein repl
nREPL server started on port 55071 on host 127.0.0.1 - nrepl://127.0.0.1:55071
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.5.1
...
user=> (demo 7 (lpf (mix (saw [50 (line 100 1600 5) 101 100.5]))
  #_=>                   (lin-lin (lf-tri (line 2 20 5)) -1 1 400 4000)))
#<synth-node[loading]: user/audition-synth 31>

No problem.


2. The instructions mention "M-x cider" but such a command does not (does no longer?) exist. I'm assuming "M-x cider-connect"? When I run cider-connect, I use "localhost" for the host and get offered "insane-noises:55071" as an option. cider-connect looks like the correct command.


3. I am immediately greeted by a lot of bold red text:

WARNING: CIDER requires nREPL 0.2.7 (or newer) to work properly
WARNING: The following required nREPL ops are not supported:
apropos classpath complete eldoc format-code format-edn info inspect-pop inspect-push inspect-refresh macroexpand ns-list ns-vars ns-path refresh resource stacktrace toggle-trace-var toggle-trace-ns undef
Please, install (or update) cider-nrepl 0.9.1 and restart CIDER
WARNING: The following nREPL ops are not supported:
artifact-list artifact-versions clean-ns configure extract-definition find-debug-fns find-symbol find-unbound hotload-dependency rename-file-or-dir resolve-missing stubs-for-interface version warm-ast-cache
Please, install (or update) refactor-nrepl and restart REPL.
You can mute this warning by changing cljr-suppress-middleware-warnings.
WARNING: CIDER's version (0.9.1) does not match cider-nrepl's version (not installed)

The echo area also shows: "if: nrepl-refactor middleware not available! Did you remember to install it?"

I'm not sure what to do now… I'm guessing adding a dependency? I looked at https://github.com/clojure-emacs/cider-nrepl and now I have this:

(defproject insane-noises "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/clojure "1.5.1"]
                 [cider/cider-nrepl "0.9.1"]
                 [overtone "0.9.1"]])

Something to add to https://github.com/overtone/overtone perhaps?
And restart the repl.

That gives some installation messages:

Retrieving cider/cider-nrepl/0.9.1/cider-nrepl-0.9.1.pom from clojars
Retrieving org/clojure/tools.nrepl/0.2.10/tools.nrepl-0.2.10.pom from central
Retrieving org/tcrawley/dynapath/0.2.3/dynapath-0.2.3.pom from central
Retrieving org/tcrawley/dynapath/0.2.3/dynapath-0.2.3.jar from central
Retrieving cider/cider-nrepl/0.9.1/cider-nrepl-0.9.1.jar from clojars
nREPL server started on port 55174 on host 127.0.0.1 - nrepl://127.0.0.1:55174

But the message stays the same, because 0.9.2 > 0.9.1 – d'oh! :)

So I tried to fix it:

alex@Megabombus:~/src/insane-noises$ lein repl
Could not find artifact cider:cider-nrepl:jar:0.9.2 in central (https://repo1.maven.org/maven2/)
Could not find artifact cider:cider-nrepl:jar:0.9.2 in clojars (https://clojars.org/repo/)
This could be due to a typo in :dependencies or network issues.

So now I'm confused. What next?

Cheers
Alex

Sam Aaron

unread,
Jul 17, 2015, 12:05:32 PM7/17/15
to emacs...@googlegroups.com
Hi Alex,

it’s possible that some docs are out of date. If you could send pull requests or just let me know where specifically things are bad, I can fix.

For now, could you try updating the deps in your ~/.lein/profiles.clj to:

:plugins [[cider/cider-nrepl "0.9.1"]
[refactor-nrepl "1.1.0"]]
:dependencies [[org.clojure/tools.nrepl "0.2.7”]]

Does that help at all?

Sam
> --
> You received this message because you are subscribed to the Google Groups "Emacs Live" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to emacs-live+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Alex Schröder

unread,
Jul 18, 2015, 3:31:19 PM7/18/15
to emacs...@googlegroups.com
Hi Sam

Yes! It worked. :)

Unfortunately I'm a total newbie when it comes to Clojure and Leiningen.
I did not  have a ~/.lein/profile.clj file before, when it worked.
I googled for an example of how to add the fragmented you posted and after some trial and error I use the following:

{:user {

 :plugins [[cider/cider-nrepl "0.9.1"]
           [refactor-nrepl "1.1.0"]]
 :dependencies [[org.clojure/tools.nrepl "0.2.7"]]
 }}

My latest restart of the REPL now produces the following:

alex@Megabombus:~/src/insane-noises$ lein repl
Retrieving org/clojure/tools.nrepl/0.2.10/tools.nrepl-0.2.10.jar from central
Retrieving org/clojure/tools.nrepl/0.2.7/tools.nrepl-0.2.7.pom from central
Retrieving org/clojure/tools.nrepl/0.2.7/tools.nrepl-0.2.7.jar from central
nREPL server started on port 55837 on host 127.0.0.1 - nrepl://127.0.0.1:55837
REPL-y 0.3.5, nREPL 0.2.7
Clojure 1.5.1

And in my Emacs, M-x cider-connect RET localhost RET insane-noises:55837 RET gives me a REPL without error message!

(use 'overtone.live)

(demo 7 (lpf (mix (saw [50 (line 100 1600 5) 101 100.5
]))
                  (lin-lin (lf-tri (line 2 20 5)) -1 1 400 4000)))
This produces the expected result. Great!

As for pull requests… I'm not so sure. I feel like a total newbie. :)

Thanks
Alex
Reply all
Reply to author
Forward
0 new messages