Lein: Exception in thread "Thread-3" java.net.ConnectException: Connection refused

leiningen

Leiningen是你的主要工具, 它用于:

  1. 启动一个 REPL
  2. 下载+安装类库
  3. 运行你的程序
  4. 启动一个服务器, 运行你所写的webapps

安装

brew install leiningen

打开repl

lein repl

1
2
3
4
5
6
7
8
9
10
11
12
13
lein repl
nREPL server started on port 50438 on host 127.0.0.1 - nrepl://127.0.0.1:50438
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.6.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_40-b25
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 *1, *2, *3, an exception in *e

user=>

运行时报错:

1
2
3
4
5
6
7
8
9
10
Exception in thread "Thread-3" java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:211)

需要执行:sudo scutil --set HostName MyName.local

详见:https://github.com/technomancy/leiningen/issues/1321

posted @ 2015-05-30 14:13  GreatK  阅读(514)  评论(0编辑  收藏  举报