3 ms·
EDIT: Clojure is easy to get up and running with! This was written before I got some excellent feedback in the comments below. Apparently I've been following an
by andrewvc 17y ago
EDIT: Clojure is easy to get up and running with! This was written before I got some excellent feedback in the comments below. Apparently I've been following an out-of-date Clojure tutorial.
I just got Halloway's book, and I have to say, getting started with Clojure isn't as seamless as it could be. I mainly want to write web-apps with it, so I thought I'd get going writing an app using compojure. Well, it turns out that I to do that I need:
1. Java
2. Clojure
3. Clojure-contrib
4. Ant
5. Maven
6. Leiningen
And there's no equivalent of CPAN or gem to fetch all this for me, IMHO, a huge pain in the ass, doubly so because a lot of this stuff involved mucking around with env vars like JAVA_HOME and CLASS_PATH. Is there an easier way to set this up than just downloading the individual packages? Something like WAMP for Clojure? I'm not looking forward to going through this again.
By comparison, in ruby I could just:
1. Download the ruby installer (Windows)/ apt-get install ruby-full (Ubuntu Linux) 2. gem install sinatra
And you're done.
- twism 17y agoHave you tried this... http://mmcgrana.github.com/2010/03/clojure-web-development-ring.html http://mmcgrana.github.com/2010/03/clojure-web-development-r... All you need is leiningen and your favorite text editor.
- andrewvc 17y agoYou're right, I have to take most of that back, that was mostly my frustration trying to install it on Arch linux, which has no Java packages. Additionally, I was following an apparently out of date tutorial that said I needed all that other stuff. On Ubuntu, I just gave it a shot, and it's much easier. apt-get install clojure maven2 Followed by downloading the leiningen self installer works just fine. Thanks for the link btw!
- weavejester 17y agoYou don't even need to install Clojure and Maven, I don't think. Leiningen downloads the relevant Clojure and Maven jar files as part of its install process.
- DTrejo 17y agoThis tutorial has good install instructions for clojure+compojure+enlive using only Leiningen (and git): http://github.com/swannodette/enlive-tutorial http://github.com/swannodette/enlive-tutorial
- twism 17y agoNot a problem. You don't even need to install clojure or maven, Leiningen takes care of all that.
- weavejester 17y agoIt should be much simpler than that. Leiningen has a "lein self-install" command that downloads all the basic dependencies. See here: http://www.assembla.com/wiki/show/clojure/Getting_Started_with_Leiningen http://www.assembla.com/wiki/show/clojure/Getting_Started_wi... Once Leiningen is installed, dependencies are handled automatically. You can use "lein new my-project" to create a new project skeleton, and then customize the project.clj file to add in new dependencies. Most Clojure projects are now up on clojars.org, which is one of the repositories included by default in Leiningen.
- andrewvc 17y agoYou're right, I was acting on some mistaken premises, I'm up and running now, thanks for the tip.
- sunkencity 17y agoI helped a friend get up and running with clojure this weekend. It's pretty simple with leiningen, just add swank, elpa and one is good to go! Of course I've wasted inumerable hours myself in the past trying to get it to work in the past but now I think it easily just works without much tweaking. We set it up two good on two OSX machines in just 20 minutes each. It would be nice though to just build a little ruby gem with the lein binary. "gem install leiningen" but that would be violating the language barriers :)
- mark_l_watson 17y agoI have a template that I have been using to get started that I wrote up (http://blog.markwatson.com/2010/04/my-clojure-ring-compojure-development.html http://blog.markwatson.com/2010/04/my-clojure-ring-compojure...) I wanted to have a template for Compojure+Ring, etc. I am creating a second template that uses congomongo + MongoDB as the backend datastore.
- bradfordw 17y agoThis is great, nicely done.
- technomancy 17y ago> Apparently I've been following an out-of-date Clojure tutorial. There's a _lot_ of out-of-date docs out there. This is probably the #1 hurdle newcomers face getting started with Clojure and Emacs at least. That's why this Getting Started wiki page is so important; it gathers it in one place where out-of-date stuff can be fixed collaboratively.