Hi, I’m trying to create a new project using lein new droid foobar
but lein can’t find the template… Guessing I have to update some dependency somewhere. The lein-droid docs say “Lein-droid is a plugin for Leiningen, so you should make sure you have Leiningen 2.3 or higher installed. This is all installation you have to do.”
(sorry for the newbie question)
@ibcoleman lein version
will give you the version number (if you're new to clojure you probably have the latest version installed). But test that hypothesis and if it's greater than 2.3 then you can rule that out as a cause. My next hypothesis states that [lein-droid "0.4.3"]
is not in your ~/.lein/profiles.clj
file
thanks @gdeer81 The odd thing is it looks like it’s resolving http://clojars.org and maven to 127.0.0.1…
➜ Projects lein version
Could not transfer artifact lein-pprint:lein-pprint:jar:1.1.1 from/to central (<https://repo1.maven.org/maven2/>): Connect to [localhost/127.0.0.1] failed: Connection refused (Connection refused)
Could not transfer artifact lein-pprint:lein-pprint:jar:1.1.1 from/to clojars (<https://repo.clojars.org/>): Connect to [localhost/127.0.0.1] failed: Connection refused (Connection refused)
Could not transfer artifact lein-pprint:lein-pprint:pom:1.1.1 from/to central (<https://repo1.maven.org/maven2/>): Connect to [localhost/127.0.0.1] failed: Connection refused (Connection refused)
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.
but if I just ping http://clojars.org or http://maven.org from the cl I get a normal resolution
Then lets follow the hypothesis that network configuration is preventing lein from connecting to clojars and maven
if I just do lein new app foobar
a new project is created w/ no issues. If I try to add any dependencies, it tries to pull them from localhost for some reason…
yes, this supports our hypothesis that it's a network issue since lein can use things are already on your machine
and yet:
➜ foobar ping <http://repo.clojars.org|repo.clojars.org>
PING <http://v.ssl.global.fastly.net|v.ssl.global.fastly.net> (151.101.201.128): 56 data bytes
64 bytes from 151.101.201.128: icmp_seq=0 ttl=59 time=7.657 ms
64 bytes from 151.101.201.128: icmp_seq=1 ttl=59 time=7.477 ms
64 bytes from 151.101.201.128: icmp_seq=2 ttl=59 time=4.471 ms
Wonder where lein is getting its name resolution from?ah yes, my hypothesis wasn't concise enough. The cause must be from a lein configuration. one I don't think I've ever seen before
So where are the points that we can configure lein?
what does your ~/.lein/profiles.clj
look like?
currently no ~/.lein/profiles.clj
(i moved it to .old)
(since there wasn’t a default one created initially by leiningen)
what version of leiningen are you using?
➜ foobar lein version
Leiningen 2.8.1 on Java 1.8.0_112 Java HotSpot(TM) 64-Bit Server VM
(on a mac)oh wow I just noticed I am still on 2.7; let me upgrade so any tests I run will match closer with your situation
thanks!
hrm, I also upgraded to 2.8 on my ubuntu laptop since the environment might be closer to a mac
I moved my profiles.clj as well and did lein new droid foo
and it worked on that machine as well
do you have any other random files in your ~/.m2
or ~/.lein
directories? Our hypothesis has boiled down to some random configuration somewhere is messing with leins idea of where the central repos are
Hmm, not that I can see:
➜ .lein ls -la ~/.lein
total 16
drwxr-xr-x 5 ian staff 160 Dec 7 11:08 .
drwxr-xr-x+ 64 ian staff 2048 Dec 7 11:54 ..
-rw-r--r-- 1 ian staff 136 Dec 7 11:03 profiles.clj.old
-rw-r--r-- 1 ian staff 28 Dec 7 10:36 repl-history
drwxr-xr-x 3 ian staff 96 Dec 7 09:43 self-installs
➜ .lein ls -la ~/.m2
total 0
drwxr-xr-x 3 ian staff 96 Jan 12 2017 .
drwxr-xr-x+ 64 ian staff 2048 Dec 7 11:54 ..
drwxr-xr-x 73 ian staff 2336 Dec 7 10:52 repository
do you still have any old self installs?
no, this is the first install on this machine. via brew install clojure && brew install leiningen
and are there any random files in the directory where you are running lein new
?
hmm. nothing but folders in there.
okay, just to rule out OS level stuff can you boot into a guest session and install and run leiningen?
hey @gdeer81, I ran out of time--thanks for all your help--gotta hit this meeting though. Thanks again!
it probably would have been better to move this conversation to #leiningen since there probably are more people in that channel that would have insight into what might be causing the issue
oh nevermind, you did ask it there as well. Daniel said it may be an environmental variable which the guest user log in might have ruled out