Fork me on GitHub
#leiningen
<
2019-02-28
>
Mattias15:02:02

java.io.IOException: Permission denied. Please check your access rights for /usr/local/bin/lein/repl-port
 at leiningen.repl$repl.invokeStatic (repl.clj:385)
    leiningen.repl$repl.doInvoke (repl.clj:316)
    clojure.lang.RestFn.invoke (RestFn.java:425)
    leiningen.repl$repl.invokeStatic (repl.clj:374)
    leiningen.repl$repl.invoke (repl.clj:316)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132) 

Alex Miller (Clojure team)15:02:55

use the ` at beginning and end

Mattias15:02:32

So, brew updated lein to 2.9.1 and now I get this. Did a bunch of searching the web but no obvious clues. Have checked various rights on folders and stuff but most seem fine. Lein works, just not the repl.

Mattias15:02:12

So maybe something with opening ports? :thinking_face:

pip15:02:27

Hi, I'm using yogthos/migratus to establish code based migrations for my application. I store them in a migrations/ dir under src/clj/. I'm able to run lein run and the migrations appear just fine. However, when I switch to lein uberjar, the code based migrations don't appear in the class path. Am I missing something? I searched a lot but I can't seem to find any direct clues. Closest thing I saw was this. https://github.com/yogthos/migratus/issues/63 Please let me know if this isn't the right channel for this.

mping14:03:49

whats ur db spec?

mping14:03:13

as for running from jar, you need your jar entry point to deal with migrations

mping14:03:32

so, the jar defines a main-class, that usually resolves to a (defn -main[&args])

mping14:03:39

that -main should handle the “migrate” case

mping14:03:28

as for the db-spec, I think migratus expects something like

{:store         :database
     :init          "init.sql"
     :migration-dir "migrations"
     :db            "jdbc:url...."}

mikerod15:02:05

@mattias504 what version were you using previously? curious, but may not know your answer

mikerod15:02:32

I would think perhaps you have an old file there somehow though that has wrong permissions. Maybe can delete it hah

mikerod15:02:26

@lpanda2014 why not store things like discussed in that linked issue?

pip16:02:41

hmm i tried doing that (putting the clj files in the resources/migrations/ folder) and they were added to the classpath but the migrations wouldn't run

Mattias16:02:02

Thanks for answering - I think it was 2.9.0? I also realized now that it works normally if I run in a project directory. Just the standalone repl that complains.

Mattias16:02:32

I also have no file “/usr/local/bin/lein/repl-port”, so maybe I’m missing something or it’s a message that requires more of the reader 😅

Mattias16:02:05

So, when doing cider-jack-in I get this. I assume it is some general version mismatch, but maybe it gives someone something:

Mattias16:02:08

For information about GNU Emacs and the GNU system, type C-h C-a.
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.5.3\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.19.0-SNAPSHOT\"\] -- repl :headless :host localhost...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: clojure.lang.Compiler$CompilerException: Syntax error compiling var at (cider/nrepl/middleware/pprint.clj:74:3).
#:clojure.error{:phase :compile-syntax-check, :line 74, :column 3, :source "cider/nrepl/middleware/pprint.clj", :symbol var}
 at clojure.lang.Compiler.analyzeSeq (Compiler.java:7114)
    clojure.lang.Compiler.analyze (Compiler.java:6789)
    clojure.lang.Compiler.analyze (Compiler.java:6745)
    clojure.lang.Compiler$InvokeExpr.parse (Compiler.java:3820)

Michael Griffiths19:02:18

Try updating your CIDER install, it should be using nrepl 0.6.0 and cider-nrepl 0.21.1

mikerod17:02:11

@mattias504 > Just the standalone repl that complains. ah, I never use this, but when in a project dir it does make a repl-port file. seems like that is just a permission issue where lein is running then perhpaps

mikerod17:02:20

And you have a question it looks like a cider problem. I think you probably just need to use a newer version of cider

Mattias18:02:37

Ah, cool. Haven’t checked Cider version. Thanks!

mikerod18:02:28

@mattias504 in modern cider, if you are doing clj (not cljs) I think you want to use cider-jack-in-clj too, I’m not sure how it compares to cider-jack-in since that still exists too (maybe it defaults to that or something)

mikerod18:02:47

but yeah, I’m wondering if an older jack-in used some too old auto-injected nrepl deps

mikerod18:02:07

or perhaps you are providing old versions of middleware in your :dependencies somehow that are clashing. remember to check ~/.lein/profiles.clj if you have some setup

Mattias18:02:28

I’m new to this stuff - mostly everything is pretty recently installed. Didn’t know about the newer jack-in. That’s the problem with information on the internet 😛

mikerod18:02:55

What isyour M-x cider-version

mikerod18:02:23

And I’m out-of-touch with the new jack-in’s and how they relate, there is cider-jack-in-clj, cider-jack-in-cljs, cider-jack-in-clj&cljs, and cider-jack-in

mikerod18:02:40

new ones make sense to me, not sure what cider-jack-in does now though

mikerod18:02:56

There is a #cider channel though and this may also be in it’s doc pages, so I’ll leave it at that for exploration

mikerod18:02:26

if you are up-to-date you think, then perhaps the injection is fine, and maybe your project is throwing an old nrepl middleware on the path some other way.

mikerod18:02:53

lein 2.9.x+ I believe changed it’s own clj version to 1.10, which perhaps introduced new compile-time syntax failures. So if you came from 2.9.0, I am a little surprised you’d break to 2.9.1, but there could be more here than I am aware of.