Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install clojure with leiningen on Ubuntu 13.04

So I go to clojure.org/downloads and it says I can get clojure via leiningen. Great. I go to leiningen.org and think I'm following the instructions. It says to get their bash script and put it in your ~/bin/ Did it. Make it executable. Did it. ...then what? run the script? It doesn't say, but I did. This creates a .lein , which I suppose it should. Now what? How do I now install clojure? This is what clojure.org/downloads says:

Modify the dependencies and repositories sections of your Leiningen project.clj file, specifying the version of Clojure that you want:
; under dependencies, select the release of clojure
; (and optionally clojure-contrib) that you want
:dependencies [[org.clojure/clojure
                "1.5.0-alpha5"]]

but I have no idea what that means since I find no "project.clj" file anywhere. ~/.lein/self-installs has a monster leiningen-2.1.3-standalone.jar file, which probably doesn't want me hacking on it. What should I do now? How could I better inform myself in the future?

like image 391
147pm Avatar asked May 17 '13 16:05

147pm


1 Answers

At this point lein should be in your path. So, typing lein or lein help at your shell prompt should bring up the task list.

To create your first project

lein new my-first-project
cd my-first-project

You should then see a project.clj in that directory. Edit the dependencies in that file if you wish to have a different Clojure version than the default. Then just enter the REPL and any dependencies (including Clojure) should be downloaded and installed for you.

lein repl

As you your last question, I'd follow the tutorial on the leiningen website immediately after completing the installation instructions.

https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md

like image 129
A. Webb Avatar answered Sep 17 '22 14:09

A. Webb