Leiningen是Clojure项目管理工具Leiningen is the easiest way to use Clojure,官网:http://leiningen.org/

1:首先下载Leiningen安装脚本:https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein

2:将其保存为lein文件然后移动到/usr/bin/目录下面(Ubuntu14.0.4 LST 64Bit)

y@y:~$ sudo mv my_note/lein /usr/bin/

修改lein权限,让其可以执行:

y@y:/usr/bin$ chmod +x lein 

3:执行lein命令,进行安装:

y@y:~$ lein
Downloading Leiningen to /home/y/.lein/self-installs/leiningen-2.4.-standalone.jar now...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
--:--:-- :: --:--:--
--:--:-- :: --:--:--
curl: () The requested URL returned error: Forbidden
Failed to download https://github.com/technomancy/leiningen/releases/download/2.4.3/leiningen-2.4.3-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.
[由于国内网络原因不能访问下载链接]
首先清除:
y@y:~$ rm .lein/ -rf

采用VPN或代理进行联网,再次运行下载成功!

y@y:~$ lein
Downloading Leiningen to /home/y/.lein/self-installs/leiningen-2.4.-standalone.jar now...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
--:--:-- :: --:--:--
14.2M 14.2M 195k :: :: --:--:-- 126k
(Retrieving org/clojure/tools.nrepl/0.2./tools.nrepl-0.2..pom from central)
(Retrieving org/clojure/pom.contrib/0.1./pom.contrib-0.1..pom from central)
(Retrieving org/sonatype/oss/oss-parent//oss-parent-.pom from central)
(Retrieving clojure-complete/clojure-complete/0.2./clojure-complete-0.2..pom from clojars)
(Retrieving org/clojure/tools.nrepl/0.2./tools.nrepl-0.2..jar from central)
(Retrieving clojure-complete/clojure-complete/0.2./clojure-complete-0.2..jar from clojars)
Leiningen is a tool for working with Clojure projects. Several tasks are available:
change Rewrite project.clj by applying a function.
check Check syntax and warn on reflection.
classpath Print the classpath of the current project.
clean Remove all files from project's target-path.
compile Compile Clojure source into .class files.
deploy Build and deploy jar to remote repository.
deps Download all dependencies.
do Higher-order task to perform other tasks in succession.
help Display a list of tasks or help for a given task.
install Install the current project to the local repository.
jar Package up all the project's files into a jar file.
javac Compile Java source files.
new Generate project scaffolding based on a template.
plugin DEPRECATED. Please use the :user profile instead.
pom Write a pom.xml file to disk for Maven interoperability.
release Perform :release-tasks.
repl Start a repl session either with the current project or standalone.
retest Run only the test namespaces which failed last time around.
run Run a -main function with optional command-line arguments.
search Search remote maven repositories for matching jars.
show-profiles List all available profiles or display one if given an argument.
test Run the project's tests.
trampoline Run a task without nesting the project's JVM inside Leiningen's.
uberjar Package up the project files and dependencies into a jar file.
update-in Perform arbitrary transformations on your project map.
upgrade Upgrade Leiningen to specified version or latest stable.
vcs Interact with the version control system.
version Print version for Leiningen and the current JVM.
with-profile Apply the given task with the profile(s) specified. Run `lein help $TASK` for details. Global Options:
-o Run a task offline.
-U Run a task after forcing update of snapshots.
-h, --help Print this help or help for a specific task.
-v, --version Print Leiningen's version. See also: readme, faq, tutorial, news, sample, profiles, deploying, gpg,
mixed-source, templates, and copying.
y@y:~$

4:运行lein repl进入控制台,发现报以下异常:

y@y:~$ lein repl
nREPL server started on port on host 127.0.0.1 - nrepl://127.0.0.1:40433
Exception in thread "nREPL-worker-0" java.lang.NoSuchMethodError: clojure.tools.nrepl.StdOutBuffer.length()I
at clojure.tools.nrepl.middleware.session$session_out$fn__7630.doInvoke(session.clj:)
at clojure.lang.RestFn.invoke(RestFn.java:)
at clojure.tools.nrepl.middleware.session.proxy$java.io.Writer$ff19274a.write(Unknown Source)
at java.io.PrintWriter.write(PrintWriter.java:)
at java.io.PrintWriter.write(PrintWriter.java:)
at clojure.core$fn__5471.invoke(core_print.clj:)
at clojure.lang.MultiFn.invoke(MultiFn.java:)
at clojure.core$pr_on.invoke(core.clj:)
at clojure.core$pr.invoke(core.clj:)
at clojure.lang.AFn.applyToHelper(AFn.java:)
at clojure.lang.RestFn.applyTo(RestFn.java:)
at clojure.core$apply.invoke(core.clj:)
at clojure.core$prn.doInvoke(core.clj:)
at clojure.lang.RestFn.applyTo(RestFn.java:)
at clojure.core$apply.invoke(core.clj:)
at clojure.core$println.doInvoke(core.clj:)
at clojure.lang.RestFn.invoke(RestFn.java:)
at clojure.main$repl_caught.invoke(main.clj:)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569$fn__7582.invoke(interruptible_eval.clj:)
at clojure.main$repl$fn__6634.invoke(main.clj:)
at clojure.main$repl.doInvoke(main.clj:)
at clojure.lang.RestFn.invoke(RestFn.java:)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569.invoke(interruptible_eval.clj:)
at clojure.lang.AFn.applyToHelper(AFn.java:)
at clojure.lang.AFn.applyTo(AFn.java:)
at clojure.core$apply.invoke(core.clj:)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:)
at clojure.lang.RestFn.invoke(RestFn.java:)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:)
at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__7610$fn__7613.invoke(interruptible_eval.clj:)
at clojure.core$comp$fn__4192.invoke(core.clj:)
at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__7603.invoke(interruptible_eval.clj:)
at clojure.lang.AFn.run(AFn.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:)
REPL-y 0.3., nREPL 0.2.-beta5NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I clojure.tools.nrepl.middleware.session/session-out/fn-- (session.clj:)NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I clojure.tools.nrepl.middleware.session/session-out/fn-- (session.clj:)#<Namespace user>Exception in thread "nREPL-worker-2" java.lang.NoSuchMethodError: clojure.tools.nrepl.StdOutBuffer.length()I
at clojure.tools.nrepl.middleware.session$session_out$fn__7630.doInvoke(session.clj:)
at clojure.lang.RestFn.invoke(RestFn.java:)
at clojure.tools.nrepl.middleware.session.proxy$java.io.Writer$ff19274a.write(Unknown Source)
at java.io.PrintWriter.write(PrintWriter.java:)
at java.io.PrintWriter.write(PrintWriter.java:)
at clojure.core$fn__5471.invoke(core_print.clj:)
at clojure.lang.MultiFn.invoke(MultiFn.java:)
at clojure.core$pr_on.invoke(core.clj:)
at clojure.core$pr.invoke(core.clj:)
at clojure.lang.AFn.applyToHelper(AFn.java:)
at clojure.lang.RestFn.applyTo(RestFn.java:)
at clojure.core$apply.invoke(core.clj:)
at clojure.core$prn.doInvoke(core.clj:)
at clojure.lang.RestFn.applyTo(RestFn.java:)
at clojure.core$apply.invoke(core.clj:)
at clojure.core$println.doInvoke(core.clj:)
at clojure.lang.RestFn.invoke(RestFn.java:)
at clojure.main$repl_caught.invoke(main.clj:)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569$fn__7582.invoke(interruptible_eval.clj:)
at clojure.main$repl$fn__6634.invoke(main.clj:)
at clojure.main$repl.doInvoke(main.clj:)
at clojure.lang.RestFn.invoke(RestFn.java:)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569.invoke(interruptible_eval.clj:)
at clojure.lang.AFn.applyToHelper(AFn.java:)
at clojure.lang.AFn.applyTo(AFn.java:)
at clojure.core$apply.invoke(core.clj:)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:)
at clojure.lang.RestFn.invoke(RestFn.java:)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:)
at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__7610$fn__7613.invoke(interruptible_eval.clj:)
at clojure.core$comp$fn__4192.invoke(core.clj:)
at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__7603.invoke(interruptible_eval.clj:)
at clojure.lang.AFn.run(AFn.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:) Error loading namespace; falling back to userNoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I clojure.tools.nrepl.middleware.session/session-out/fn-- (session.clj:)NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I clojure.tools.nrepl.middleware.session/session-out/fn-- (session.clj:)user=>

google了一番原来是leiningen2.4.3的一个BUG:https://github.com/technomancy/leiningen/issues/1625

解决方法:将其回退到2.4.2版

y@y:~$ lein downgrade 2.4.
Downloading Leiningen to /home/y/.lein/self-installs/leiningen-2.4.-standalone.jar now...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
--:--:-- :: --:--:--
13.2M 13.2M 432k :: :: --:--:-- 611k
The script at /usr/bin/lein will be upgraded to the latest 2.4. version.
Do you want to continue [Y/n]? Y Upgrading...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
--:--:-- :: --:--:--
:: :: --:--:--
mv: 无法将"/tmp/lein-12771-upgrade" 移动至"/usr/bin/lein": 权限不够
Leiningen 2.4. on Java 1.7.0_55 Java HotSpot(TM) -Bit Server VM

5:再次运行lein repl 成功

y@y:~$ lein repl
nREPL server started on port on host 127.0.0.1 - nrepl://127.0.0.1:33169
REPL-y 0.3.
Clojure 1.6.
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *, *, *, an exception in *e user=>

输出helo,world

user=> (println "Hello,world!")
Hello,world!
nil
user=>

leiningen安装记录的更多相关文章

  1. 分布式监控系统Zabbix-3.0.3-完整安装记录(7)-使用percona监控MySQL

    前面已经介绍了分布式监控系统Zabbix-3.0.3-完整安装记录(2)-添加mysql监控,但是没有提供可以直接使用的Key,太过简陋,监控效果不佳.要想更加仔细的监控Mysql,业内同学们都会选择 ...

  2. 关于node.js和npm,cnpm的安装记录以及gulp自动构建工具的使用

    关于node.js和npm,cnpm的安装记录以及gulp自动构建工具的使用   工作环境:window下 在一切的最开始,安装node.js (中文站,更新比较慢http://nodejs.cn/) ...

  3. sourceinsight安装记录

    sourceinsight安装记录 此文章为本人使用sourceinsight一个星期之后的相关设置步骤记录和经验记录,以备以后查验,网上的相关资料都也较为完善,但是对于新手还是有一定困难的,所以在这 ...

  4. openerp安装记录及postgresql数据库问题解决

    ubuntu-14.04下openerp安装记录1.安装PostgreSQL 数据库    a.安装         sudo apt-get install postgresql    安装后ubu ...

  5. Matlab安装记录 - LED Control Activex控件安装

    Matlab安装记录-LED Control Activex控件安装 2013-12-01  22:06:36 最近在研究Matlab GUI技术,准备用于制作上位机程序:在Matlab GUI的技术 ...

  6. Arch Linux 安装记录

    Arch Linux 安装记录 基本上参考wiki上的新手指南,使用arch 2014.6.1 iso安装 设置网络 有线网络 Arch Linux 默认开启DHCP. 静态ip 首先关闭DHCP:s ...

  7. redis5.0.3单实例简单安装记录

    redis5.0.3单实例简单安装记录 日常需要测试使用,索性记录下来,免得临时又麻烦的找资料. yum -y install make gcc-c++ cmake bison-devel ncurs ...

  8. mysql5.7安装记录

    mysql安装记录 版本5.7 windows系统 一.缺少my.ini文件 [mysql]# 设置mysql客户端默认字符集default-character-set=utf8 [mysqld]#设 ...

  9. Liunx/RHEL6.5 Oracle11 安装记录

    1.创建用户组 groupadd oinstall #创建用户组oinstall groupadd dba #创建用户组dba useradd -g oinstall -g dba -m oracle ...

随机推荐

  1. LeetCode_String to Integer (atoi)

    Implement atoi to convert a string to an integer. int atoi (const char * str); Convert string to int ...

  2. 《Programming WPF》翻译 第9章 2.选择一个基类

    原文:<Programming WPF>翻译 第9章 2.选择一个基类 WPF提供了很多类,当创建一个自定义元素时,你可以从这些类中派生.图9-1显示了一组可能作为类--可能是合适的基类, ...

  3. XPath <第四篇>

    .Net框架下的System.Xml.XPath命名空间提供了一系列的类,允许你应用XPath数据模式查询和展示XML文档数据. 一.XPath介绍 XPath有七种类型的节点:元素.属性.文本.命名 ...

  4. SQL Server 性能优化之——重复索引

    原文 http://www.cnblogs.com/BoyceYang/archive/2013/06/16/3139006.html 阅读导航 1. 概述 2. 什么是重复索引 3. 查找重复索引 ...

  5. HDU 1576 A/B(数论)

    题目:求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1).数据给出n和b 推导过程 A/B = K K = 9973* ...

  6. gitlab升级方法

    gitlab升级方法:国内网络环境推荐方法二方法一:官网的升级方式 (1)停止git服务 gitlab-ctl stop unicorn gitlab-ctl stop sidekiq gitlab- ...

  7. [Immutable.js] Working with Subsets of an Immutable.js Map()

    Immutable.js offers methods to break immutable structures into subsets much like Array--for instance ...

  8. [Protractor] Protractor Interactive with elementor

    Install: npm install -g elementor Then run: webdriver-manager start Lets say if we want to test 'htt ...

  9. 用gitolite新建项目,clone后首次push,可能会出现: git: No refs in common and none specified; doing no

    用gitolite新建项目,clone后首次push,可能会出现:     $ git push No refs in common and none specified; doing nothing ...

  10. fullcalendar .net版本

    实现了基本的增删改和拖拽,先记与此,抽时间继续优化和完善. 参考链接:http://www.helloweba.com/tag-fullcalendar.html 参考demo:   http://f ...