0

I am trying to make leiningen work. I am using Windows 7. When I run in the command window

C:\lein new app my-app

I get the following error. Does anyone know what this means and where the error is occuring?

There is an explanation of the error message here but I did not understand if there is a fix or what causes the error.

C:\Users\a\work>lein new app my-app
java.lang.UnsupportedOperationException: nth not supported on this type: Symbol
        at clojure.lang.RT.nthFrom(RT.java:857)
        at clojure.lang.RT.nth(RT.java:807)
        at leiningen.core.project$dep_key.invoke(project.clj:175)
        at leiningen.core.project$reduce_dep_step.invoke(project.clj:183)
        at clojure.lang.ArrayChunk.reduce(ArrayChunk.java:58)
        at clojure.core.protocols$fn__6041.invoke(protocols.clj:98)
        at clojure.core.protocols$fn__6005$G__6000__6014.invoke(protocols.clj:19
)
        at clojure.core.protocols$seq_reduce.invoke(protocols.clj:31)
        at clojure.core.protocols$fn__6024.invoke(protocols.clj:60)
        at clojure.core.protocols$fn__5979$G__5974__5992.invoke(protocols.clj:13
)
        at clojure.core$reduce.invoke(core.clj:6177)
        at leiningen.core.project$meta_merge.invoke(project.clj:391)
        at clojure.core$merge_with$merge_entry__4279.invoke(core.clj:2698)
        at clojure.core$reduce1.invoke(core.clj:896)
        at clojure.core$merge_with$merge2__4281.invoke(core.clj:2701)
        at clojure.core$reduce1.invoke(core.clj:896)
        at clojure.core$reduce1.invoke(core.clj:887)
        at clojure.core$merge_with.doInvoke(core.clj:2702)
        at clojure.lang.RestFn.invoke(RestFn.java:439)
        at leiningen.core.project$meta_merge.invoke(project.clj:395)
        at leiningen.core.project$apply_profiles$fn__1009.invoke(project.clj:417
)
        at clojure.lang.ArrayChunk.reduce(ArrayChunk.java:58)
        at clojure.core.protocols$fn__6041.invoke(protocols.clj:98)
        at clojure.core.protocols$fn__6005$G__6000__6014.invoke(protocols.clj:19
)
        at clojure.core.protocols$seq_reduce.invoke(protocols.clj:31)
        at clojure.core.protocols$fn__6026.invoke(protocols.clj:54)
        at clojure.core.protocols$fn__5979$G__5974__5992.invoke(protocols.clj:13
)
        at clojure.core$reduce.invoke(core.clj:6177)
        at leiningen.core.project$apply_profiles.invoke(project.clj:415)
        at leiningen.core.project$init_profiles.doInvoke(project.clj:603)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at leiningen.core.main$_main$fn__1332.invoke(main.clj:257)
        at leiningen.core.main$_main.doInvoke(main.clj:252)
        at clojure.lang.RestFn.invoke(RestFn.java:436)
        at clojure.lang.Var.invoke(Var.java:423)
        at clojure.lang.AFn.applyToHelper(AFn.java:167)
        at clojure.lang.Var.applyTo(Var.java:532)
        at clojure.core$apply.invoke(core.clj:617)
        at clojure.main$main_opt.invoke(main.clj:335)
        at clojure.main$main.doInvoke(main.clj:440)
        at clojure.lang.RestFn.invoke(RestFn.java:482)
        at clojure.lang.Var.invoke(Var.java:431)
        at clojure.lang.AFn.applyToHelper(AFn.java:178)
        at clojure.lang.Var.applyTo(Var.java:532)
        at clojure.main.main(main.java:37)
C:\Users\a\work
Zeynel
  • 13,145
  • 31
  • 100
  • 145
  • 1
    This looks like a lein bug. The error means that it is trying to treat a symbol as a list (likely in a destructuring context), it seems like it may be somewhere in evaluating the project.clj that it just generated for the app. – noisesmith Oct 01 '13 at 23:53
  • Any suggestions how to fix it? – Zeynel Oct 02 '13 at 00:08
  • 1
    Maybe try reinstalling lein? Which version are you using and where did you download it? – Rörd Oct 02 '13 at 00:26
  • 1
    Find a lein version that works better on your OS, or use an OS better supported by lein, I guess. I get the impression that most clojure developers use OSX or Linux, so the tools tend to be more stable on those platforms. – noisesmith Oct 02 '13 at 00:27
  • @rörd and @noisesmith Thanks. I reinstalled lein with `lein.bat` instead of Windows installer and it is all working now. Can one of you please add this as an answer so that I can select it? Thanks again. – Zeynel Oct 02 '13 at 01:02

2 Answers2

2

As requested, here's my comment transferred into an answer. I suggested reinstalling Leiningen because apparently a broken Leiningen installation was the source of the problem.

As a little background explanation, I'm using Leiningen on both Linux and Windows, and I've made the experience myself that the primary method for installing Leiningen recommended on its homepage, the lein resp. lein.bat script, just works, whereas the alternative installation methods (Linux package managers, Windows installer) often produce broken installations.

Rörd
  • 6,556
  • 21
  • 27
1

I think it's highly unlikely that this is essentially a leiningen error, since I can reproduce it without leiningen being involved in any way:

user=> (let [[foo bar] :froboz] (list foo bar))

UnsupportedOperationException nth not supported on this type: Keyword clojure.lang.RT.nthFrom (RT.java:857)

Simon Brooke
  • 162
  • 2
  • 8