Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

leiningen install lein-noir failed

I'm just starting learning Clojure and web programming. I've installed Leiningen 2.0.0-preview2 on Clojure 1.3.0 and it can create projects correctly. But I always got That's not a task. Use "lein help" to list all tasks. error when I ran lein plugin install lein-noir 1.2.1 to install noir.

I've also tried to added lein-noir as a :dev-dependencies into project.clj and ran lein deps but it did nothing.

Does anyone know what's the problem and how can I resolve it. Thanks a lot!

My environment:

  • Mac OS X 10.6.8
  • Java 6
  • Leiningen 2.0.0-preview2

I've also tryed Leiningen 1.7 but got different error and someone said it's because leiningen 1.7 can only work with Clojure 1.2.x Here's the error when I use Leiningen 1.7:

Exception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.(ILclojure/lang/Keyword;)V
    at clojure.lang.Util.runtimeException(Util.java:165)
    at clojure.lang.Compiler.eval(Compiler.java:6476)
    at clojure.lang.Compiler.eval(Compiler.java:6431)
    at clojure.core$eval.invoke(core.clj:2795)
    at clojure.main$eval_opt.invoke(main.clj:296)
    at clojure.main$initialize.invoke(main.clj:315)
    at clojure.main$script_opt.invoke(main.clj:339)
    at clojure.main$main.doInvoke(main.clj:426)
    at clojure.lang.RestFn.invoke(RestFn.java:551)
    at clojure.lang.Var.invoke(Var.java:426)
    at clojure.lang.AFn.applyToHelper(AFn.java:193)
    at clojure.lang.Var.applyTo(Var.java:518)
    at clojure.main.main(main.java:37)
Caused by: java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.(ILclojure/lang/Keyword;)V
    at leiningen.util.plugins$stale_QMARK_.(plugins.clj:68)
    at leiningen.util.plugins__init.load(Unknown Source)
    at leiningen.util.plugins__init.(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at clojure.lang.RT.loadClassForName(RT.java:2030)
    at clojure.lang.RT.load(RT.java:417)
    at clojure.lang.RT.load(RT.java:398)
    at clojure.core$load$fn__4610.invoke(core.clj:5386)
    at clojure.core$load.doInvoke(core.clj:5385)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5200)
    at clojure.core$load_lib.doInvoke(core.clj:5237)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$load_libs.doInvoke(core.clj:5271)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:604)
    at clojure.core$use.doInvoke(core.clj:5363)
    at clojure.lang.RestFn.invoke(RestFn.java:482)
    at leiningen.core$loading__4414__auto__.invoke(core.clj:1)
    at leiningen.core__init.load(Unknown Source)
    at leiningen.core__init.(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at clojure.lang.RT.loadClassForName(RT.java:2030)
    at clojure.lang.RT.load(RT.java:417)
    at clojure.lang.RT.load(RT.java:398)
    at clojure.core$load$fn__4610.invoke(core.clj:5386)
    at clojure.core$load.doInvoke(core.clj:5385)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5200)
    at clojure.core$load_lib.doInvoke(core.clj:5237)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$load_libs.doInvoke(core.clj:5271)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:604)
    at clojure.core$use.doInvoke(core.clj:5363)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at user$eval1.invoke(NO_SOURCE_FILE:1)
    at clojure.lang.Compiler.eval(Compiler.java:6465)
    ... 11 more
like image 599
vreal Avatar asked Mar 12 '12 05:03

vreal


2 Answers

If you have added lein-noir to .lein/profiles.clj like above you need to run the command : lein new noir yoursitename. Not lein noir new my-website !

Also add lein-noir "1.2.1"

like image 80
C.A Avatar answered Oct 20 '22 07:10

C.A


Leiningen 2 is very new. Most of the documentation out there is still describing how to do things with leiningen 1.7.0. The ways you've tried to install lein-noir don't work with leiningen 2. The documentation describing how lein version 2 is different from lein 1.7.0 can be found here.

In a nutshell, you need to create a profiles.clj file in your ~/.lein directory. To specify you want to use lein-noir, your ~/.lein/profiles.clj file should look like:

{:user {:plugins [[lein-noir "1.2.1"]]}}

Now you can create a new noir project by typing:

lein new noir projectname
like image 33
Brian Avatar answered Oct 20 '22 06:10

Brian