Fork me on GitHub
#beginners
<
2018-10-12
>
dfcarpenter01:10:02

I had leiningen working to spin up a few small beginner projects but now it has stopped working. I tried lein new pedestal-service myapp as well as lein new reagent testapp and I keep getting the failure.

Failed to resolve version for pedestal-service:lein-template:jar:RELEASE: Could not find metadata pedestal-service:lein-template/maven-metadata.xml in local (/Users/dan/.m2/repository)
Failed to resolve version for pedestal-service:lein-template:jar:RELEASE: Could not find metadata pedestal-service:lein-template/maven-metadata.xml in local (/Users/dan/.m2/repository)
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
Could not find template pedestal-service on the classpath.

No idea why.

seancorfield01:10:52

@dfcarpenter That almost sounds like either lein can't reach Clojars/Maven or your local .m2 repo cache is corrupted?

dfcarpenter01:10:09

Should I just delete the cache?

seancorfield01:10:56

I ran lein new pedestal-service myapp and it worked fine, finding version 0.5.4.

seancorfield01:10:48

You might also want to check your ~/.lein/profiles.clj file -- the most common problems for beginners with Leiningen all seem to stem from having odd stuff in that file.

mfiano01:10:38

As a beginner, I can attest to that.

mfiano01:10:50

Though I use tools.deps now

iagwanderson02:10:33

hi people, I’d like to know what are the best training courses for clojure and datomic out there. I’m doing a research for a company about resources and devs available to work on a project running totally on datomic, clojure and clojurescript

alexmiller12:10:04

For Datomic, only Cognitect does training for that as far as I know

iagwanderson16:10:18

thanks @ I’m from Brazil and I’ll try to make it to the clojure/conj this year. I’m moving forward with a company here and datomic just match all the requirements we have for the finance problem we are trying to solve.

andy.fingerhut03:10:57

I haven't paid for any Clojure training before, but am aware that Cognitect and Eric Normand offer several for-pay options that you may want to examine. I don't know if anyone but Cognitect offers Datomic training.

andy.fingerhut03:10:44

If you are looking to limit yourself to free sources, or relatively inexpensive books (as compared to paying someone for training), there are lots of options for Clojure and some for ClojureScript. Other than the on-line public Datomic docs, I don't know of free sources there.

sb06:10:10

https://lambdaisland.com/episodes/datomic-quickstart-part-2, if not just Datomic.. I advice check these courses too: https://tbaldridge.pivotshare.com, http://learnreagent.com (cljs-shadow), and few video course e.g. on SafariBooks

sb08:10:01

I call macros from cljs. If I want to access to local variables, like at clj, is that possible? eg:

sb08:10:31

If I call from cljs part.. I got this {:protocol-inline :protocol-inline, :fn-scope :fn-scope, :locals :locals, :js-globals :js-globals, :ns :ns, :protocol-impl :protocol-impl, :column :column, :line :line, :context :context}

sb08:10:02

what I would like to get, eg from Mastering Clojure Macros (let [foo "bar" baz "quux"] (inspect-caller-locals)) {baz "quux", foo "bar"}

sb09:10:15

Sorry, I solved with ~'

arthurg.luz15:10:15

Hey guys, I am getting into web development in clojure and was able to run a simple server using http-kit. The problem I'm having is when I try to use the components library I get the following error: Exception in thread "main" java.io.FileNotFoundException: Could not locate component__init.class or component.clj on classpath., compiling:(first_web/core.clj:1:1) I am importing the library following the instructions on github.

noisesmith15:10:25

@sb an alternate definition

(ins)user=> (defmacro locals [] (into {} (map (juxt (partial list 'quote) identity)) (keys &env)))
#'user/locals
(cmd)user=> (let [a 0] (locals))
{a 0}

noisesmith15:10:16

I typically use (comp keyword name) instead of (partial list 'quote) because having keywords as keys is useful

sb16:10:44

Thanks! I try it!! :+1:

gon15:10:31

@arthurg.luz did you try to restart your repl after you imported the library ?

arthurg.luz15:10:38

Yep, I even tried calling lein run in terminal with the main function calling the start-server

arthurg.luz15:10:12

@gon Even tried creating a whole new project, only importing the components library and running the sample main through lein run. Still getting the same error

noisesmith15:10:30

I would not expect the ns to just be component. Probably stuartsierra.component?

noisesmith15:10:52

(based on reading the error message)

noisesmith15:10:26

What does the ns form look like in the file that errors?

noisesmith15:10:44

Correction, require com.stuartsierra.component

arthurg.luz15:10:54

(ns first-web.core
  (:require [com.stuarsierra.components :as components]))

arthurg.luz15:10:54

(ns first-web.core
  (:require [com.stuarsierra.components :as components]))

dpsutton15:10:38

you can do multiline code blocks by using triple backquotes

and this 
preserves newlines
(use control enter to get a newline and not "submit")

arthurg.luz15:10:34

Ok I just realized what I got wrong.

noisesmith15:10:06

It's component, not components

arthurg.luz15:10:43

Yep, I just changed that, but still got the same error.

(ns weeb.core
  (:require [com.stuarsierra.component :as components]))
Still gives me the classpath error

noisesmith15:10:14

It's still misspelled

arthurg.luz15:10:21

Ok, that was embarrassing, spent 1 hour trying to figure out two misspelling mistakes.. Thank you

iagwanderson16:10:56

I’m trying to run lein test through http://travis.ci and it seems that it’s not finding my config edn files. I am using the yogthos/config library and it just seems fine at my computer. my .travis.yml is just language:clojure \n script: lein test

noisesmith16:10:27

how does the code get to travis? is it a git repo? a jar that gets downloaded?

iagwanderson16:10:49

it’s a git repo

noisesmith17:10:30

the only thing I could think is if the edn files aren't in git, or some configuration that makes lein find them is only in your local config

iagwanderson17:10:36

if you check the error it says actual: java.net.MalformedURLException: no protocol: getBalance because I basically do (str (:url env) "getBalance"), therefore the env variable must be nil

hiredman17:10:56

the config files in config// are not named correctly

iagwanderson17:10:56

@hiredman actually, I’m building the dev branch which had no config.edn file at all!! because of my good’old deprecated .gitignore

clarkenciel21:10:14

having a bit of an odd issue with an uberjar. when i try to java -jar target/my-uberjar.jar the following error gets thrown:

Exception in thread "main" java.lang.NoClassDefFoundError: ring/util/response$get_resources

clarkenciel21:10:49

i don’t use ring directly as a dependency (trying out aleph for this), but it looks like compojure (which i am using) depends on it

clarkenciel21:10:47

when i look at the source for the compojure version i’m depending on, i don’t see any use of get-resources anyway though

clarkenciel21:10:55

also, when i start everything up via the repl there’s no issue

iagwanderson22:10:11

@clarkenciel how do you created the uberjar?

clarkenciel22:10:32

i’m using lein uberjar

clarkenciel22:10:37

i think i got it figured out though

clarkenciel22:10:07

i was using :uberjar-exclusions and one of them was #"resources"

clarkenciel22:10:30

so i think lein was excluding get-resources because of that match