Jim Lynch Codes
  • Blog
  • About Jim

Writings about one coder's stories & experiences.

Setting Up Leiningen On Mac OS

10/24/2016

0 Comments

 
Leiningen basically gives you a REPL for running and evaluating Clojure from the command line. This is the "de facto" way to get up and running with Clojure, and it works fine. I've installed this a few times now on Mac OS, and every time I have to go look up how to do it again (scroll to the bottom for links to other tutorials on this subject). I figured writing a tutorial myself might burn it into my memory better, and also it might help out some other lucky duck that wants to start using Clojure.

Make Sure You Have Java

Since Clojure runs on the JVM by default, Leiningen depends on the java sdk. You can check to make sure you have java like this:
java -version

Enter /usr/local/bin

Boot up your command line and navigate into your /usr/local/bin directory. If you don't have one you can create it with the mkdir â€‹command.
cd /usr/local/bin

Get the Magical Lein file

Curl is used for downloading things. This mysterious command is really just downloading an executable named "lein" that sets up your machine to be able to use Clojure.
curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > lein

Allow the Lein File to Be Executed

You computer won't know that this is an executable file, especially since it has no extension. You can rectify this by using chmod to modify permissions with a+x to give it executable permissions. 
sudo chmod a+x /usr/local/bin/lein

Ensure /usr/local/bin/ Is In Your $PATH

You check the value of your $PATH variable like this:
echo $PATH
If you don't see /usr/local/bin then I would recommend adding it to your .bash_profile file.
vim ~/.bash_profile

Run Lein (While Inside of /usr/local/bin)

Executing the lein file for the first time will install everything necessary to begin working with Clojure. You can then execute the lein file like this:
lein

Celebrate!

You're good to go now! You should now be able to use the lein command inside of any folder! Yeah buddy! You can check that it's working by running this:
lein version

Links & Other Resources

  • http://www.hildeberto.com/2015/07/installing-leiningen-on-mac-os.html
  • http://www.lispcast.com/clojure-mac
  • https://gist.github.com/technomancy/2395913
  • http://leiningen.org/
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    ​Author

    Picture
    The posts on this site are written and maintained by Jim Lynch. About Jim...
    Follow @JimLynchCodes
    Follow @JimLynchCodes

    Want FREE access to
    my daily stock tips 
    ​newsletters??
    Sign up here:

    - Triple Gainers
    - Rippers N' Dippers
    - Growingest Growers
    ​

    Categories

    All
    Actionscript 3
    Angular
    AngularJS
    Automated Testing
    AWS Lambda
    Behavior Driven Development
    Blogging
    Business Building
    C#
    C / C++
    ClojureScript / Clojure
    Coding
    Community Service
    CS Philosophy
    Css / Scss
    Dev Ops
    Firebase
    Fitness
    Flash
    Front End
    Functional Programming
    Git
    Go Lang
    Haskell
    Illustrations
    Java
    Javascript
    Lean
    Life
    Linux
    Logic Pro
    Music
    Node.js
    Planning
    Productivity
    Professionalism
    Python
    React
    Redux / Ngrx
    Refactoring
    Reusable Components
    Rust
    Security
    Serverless
    Shell Scripting
    Swift
    Test Driven Development
    Things
    TypeScript
    Useful Sites
    Useful Tools
    Video
    Website Development
    WebStorm
    Writing

    Archives

    February 2021
    January 2021
    October 2020
    September 2020
    May 2020
    April 2020
    February 2020
    January 2020
    December 2019
    October 2019
    September 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    August 2017
    July 2017
    May 2017
    April 2017
    March 2017
    February 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015

    RSS Feed

  • Blog
  • About Jim
JimLynchCodes © 2021