当我执行lein repl
时,它可以正常工作,但当我尝试连接到主机时,我会拒绝连接错误。
Connecting to nREPL at 127.0.0.1:7000
ConnectException Connection refused (Connection refused)
java.net.PlainSocketImpl.socketConnect (PlainSocketImpl.java:-2)
java.net.AbstractPlainSocketImpl.doConnect (AbstractPlainSocketImpl.java:400)
java.net.AbstractPlainSocketImpl.connectToAddress (AbstractPlainSocketImpl.java:243)
java.net.AbstractPlainSocketImpl.connect (AbstractPlainSocketImpl.java:225)
java.net.SocksSocketImpl.connect (SocksSocketImpl.java:402)
java.net.Socket.connect (Socket.java:591)
java.net.Socket.connect (Socket.java:540)
java.net.Socket.<init> (Socket.java:436)
java.net.Socket.<init> (Socket.java:213)
clojure.tools.nrepl/connect (nrepl.clj:184)
clojure.tools.nrepl/connect (nrepl.clj:174)
clojure.core/apply (core.clj:646)
Bye for now!
我曾尝试弄乱我的/etc/hosts
:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
但改变它并没有帮助。
设置:
MacOS 10.13.2
Leiningen 2.8.1 on Java 9.0.1 Java HotSpot(TM) 64-Bit Server VM
答案 0 :(得分:3)
运行lein repl
将启动自己的nREPL并连接到它。指定:connect 7000
将启动一个REPL - 它希望已经在该端口上运行。
$ lein repl
nREPL server started on port 57535 on host 127.0.0.1 - nrepl://127.0.0.1:57535
REPL-y 0.3.7, nREPL 0.2.12
在单独的会话中,您应该能够连接到其他/正在运行的REPL:
$ lein repl :connect 57535
Connecting to nREPL at 127.0.0.1:57535
REPL-y 0.3.7, nREPL 0.2.12