Use latest Clojure with lein repl

512 views
Skip to first unread message

Cecil Westerhof

unread,
Jul 13, 2016, 7:20:55 AM7/13/16
to clo...@googlegroups.com
After a long time I want to start with Clojure again. As I understand it, it is best to use:
    lein repl

But then I work with 1.5.1. Is there a way to work default with the latest stable version of Clojure?

--
Cecil Westerhof

John Szakmeister

unread,
Jul 13, 2016, 8:45:11 AM7/13/16
to clo...@googlegroups.com
I think you probably want to run "lein upgrade". My version currently
provides a REPL for Clojure 1.8.0 without any special options.

-John

Cecil Westerhof

unread,
Jul 13, 2016, 9:59:56 AM7/13/16
to clo...@googlegroups.com


​I already tried that, but this gives:
WARNING: You're currently running as root; probably by accident.
Press control-C to abort or Enter to continue as root.
Set LEIN_ROOT to disable this warning.

Downloading Leiningen to /root/.lein/self-installs/leiningen-2.3.4-standalone.jar now...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (22) The requested URL returned error: 403 Forbidden
Failed to download https://leiningen.s3.amazonaws.com/downloads/leiningen-2.3.4-standalone.jar
It's possible your HTTP client's certificate store does not have the
correct certificate authority needed. This is often caused by an
out-of-date version of libssl. Either upgrade it or set HTTP_CLIENT
to turn off certificate checks:
  export HTTP_CLIENT="wget --no-check-certificate -O" # or
  export HTTP_CLIENT="curl --insecure -f -L -o"
It's also possible that you're behind a firewall haven't yet
set HTTP_PROXY and HTTPS_PROXY.

​I now just installed it again. And that works. But what if I default want to work with a newer (or older) version. I understood it could be done with profile.clj, but I did not get it working.


​At the moment every user has to install lein, is there a way to install it globally?

--
Cecil Westerhof

John Szakmeister

unread,
Jul 13, 2016, 10:28:27 AM7/13/16
to clo...@googlegroups.com
On Wed, Jul 13, 2016 at 9:59 AM, Cecil Westerhof <cldwes...@gmail.com> wrote:
[snip]
> I already tried that, but this gives:
> WARNING: You're currently running as root; probably by accident.
> Press control-C to abort or Enter to continue as root.
> Set LEIN_ROOT to disable this warning.
>
> Downloading Leiningen to
> /root/.lein/self-installs/leiningen-2.3.4-standalone.jar now...
> % Total % Received % Xferd Average Speed Time Time Time
> Current
> Dload Upload Total Spent Left
> Speed
> 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
> 0curl: (22) The requested URL returned error: 403 Forbidden
> Failed to download
> https://leiningen.s3.amazonaws.com/downloads/leiningen-2.3.4-standalone.jar
> It's possible your HTTP client's certificate store does not have the
> correct certificate authority needed. This is often caused by an
> out-of-date version of libssl. Either upgrade it or set HTTP_CLIENT
> to turn off certificate checks:
> export HTTP_CLIENT="wget --no-check-certificate -O" # or
> export HTTP_CLIENT="curl --insecure -f -L -o"
> It's also possible that you're behind a firewall haven't yet
> set HTTP_PROXY and HTTPS_PROXY.

I think that might have been because the client was so far out-of-date.

> I now just installed it again. And that works. But what if I default want to
> work with a newer (or older) version. I understood it could be done with
> profile.clj, but I did not get it working.

I haven't done it, but perhaps look at:
https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#replacing-default-repl-dependencies

> At the moment every user has to install lein, is there a way to install it
> globally?

Not that I'm aware of, but someone else here may know.

-John

Alex Miller

unread,
Jul 13, 2016, 11:26:49 AM7/13/16
to Clojure, jo...@szakmeister.net
You might need to upgrade your Java version as well to have newer CAs to authenticate SSL to download lein! Check java -version and JAVA_HOME.

Cecil Westerhof

unread,
Jul 13, 2016, 11:29:31 AM7/13/16
to clo...@googlegroups.com
2016-07-13 16:28 GMT+02:00 John Szakmeister <jo...@szakmeister.net>:
> I now just installed it again. And that works. But what if I default want to
> work with a newer (or older) version. I understood it could be done with
> profile.clj, but I did not get it working.

I haven't done it, but perhaps look at:
https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#replacing-default-repl-dependencies

​That solved my ‘problem’. It has to be profiles.clj instead of profile.clj. (plural)
I have:
{
    :repl {
        :dependencies [
            ^:displace [org.clojure/clojure "1.4.0"]
        ]
    }
}

And that worked. I only used 1.4.0 to be sure that it worked. I put i​t back to 1.8.0.

--
Cecil Westerhof
Reply all
Reply to author
Forward
0 new messages