tisdag 24 april 2012

Leiningen on Windows/Cygwin

I've started to experiment with Noir which is a web framework for Clojure that seems really cool. In doing so I also made my first close encounter with Leiningen which seems really convenient.
Since I'm using Windows (strange huh?) I decide to run Leiningen through Cygwin (you also have the option of running a batch file but I haven't tried that yet). In doing so I found small problem with running Leiningen plugins.

Downloading and installing the plugin seemed to work as planned:

$ lein plugin install lein-noir 1.2.1
[INFO] Unable to find resource 'lein-noir:lein-noir:jar:1.2.1' in repository central (http://repo1.maven.org/maven2)
Copying 1 file to C:\cygwin\tmp\lein-db2bc8b7-7c28-4c97-a2f1-71caaa04d00c\lib
Including lein-noir-1.2.1.jar
Including clojure-1.2.1.jar
Created lein-noir-1.2.1.jar


When trying to run the plugin it doesn't seem to be installed however:

$ lein noir new first-site
That's not a task. Use "lein help" to list all tasks.

Seems like the plugin isn't installed after all... It turns out that Leiningen, Cygwin and Windows do not seem have the same idea of where your home directory is located. All plugins should be installed under $HOME/.lein/plugins/.


What you need to do is locate where Leiningen stored your new plugin. For example by doing:
$ find . -name 'lein-noir-1.2.1.jar'

Once you know where it is you simply have to copy it to $HOME/.lein/plugins/:

$ cp <Location from previous step>/lein-noir-1.2.1.jar $HOME/.lein/plugins/



That's it! You should now be able to use you're newly acquired plugin.

$ lein noir new first-site
Creating noir project:  first-site
Creating new dirs at:  D:\Development\noir\first-site
Adding files...
Project created!


Inga kommentarer:

Skicka en kommentar