2015-06-12 115 views
1

我是clojure的新手,在我做了第一個clojure Hello World項目之後,我嘗試啓動了repl,但是我得到了Connection denied錯誤。請幫忙!Clojure repl連接關閉

我鍵入的命令是雷音REPL

Exception in thread "main" java.net.ConnectException: Connection refused, compiling:(/private/var/folders/wz/jk4mqxs57fb4m27sly8fyqkh0000gn/T/form-init1330852264199133435.clj:1:124) 

     at clojure.lang.Compiler.load(Compiler.java:7142) 
     at clojure.lang.Compiler.loadFile(Compiler.java:7086) 
     at clojure.main$load_script.invoke(main.clj:274) 
     at clojure.main$init_opt.invoke(main.clj:279) 
     at clojure.main$initialize.invoke(main.clj:307) 
     at clojure.main$null_opt.invoke(main.clj:342) 
     at clojure.main$main.doInvoke(main.clj:420) 
     at clojure.lang.RestFn.invoke(RestFn.java:421) 
     at clojure.lang.Var.invoke(Var.java:383) 
     at clojure.lang.AFn.applyToHelper(AFn.java:156) 
     at clojure.lang.Var.applyTo(Var.java:700) 
     at clojure.main.main(main.java:37) 

Caused by: 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) 
     at clojure.tools.nrepl$connect.doInvoke(nrepl.clj:184) 
     at clojure.lang.RestFn.invoke(RestFn.java:421) 
     at clojure.tools.nrepl.ack$send_ack.invoke(ack.clj:47) 
     at clojure.tools.nrepl.server$start_server.doInvoke(server.clj:153) 
     at clojure.lang.RestFn.invoke(RestFn.java:619) 
     at clojure_noob.core$eval1096.invoke(form-init1330852264199133435.clj:1) 
     at clojure.lang.Compiler.eval(Compiler.java:6703) 
     at clojure.lang.Compiler.eval(Compiler.java:6693) 
     at clojure.lang.Compiler.eval(Compiler.java:6693) 
     at clojure.lang.Compiler.load(Compiler.java:7130) 
     ... 11 more 
+1

哪個平臺是你(的Linux,Windows)中?你如何開始repl(我猜)?包括呼叫和輸出的頂部。 – schaueho

+0

他正在通過/ private/var/folders/...尋找一個mac路徑 –

+0

您正在使用哪個Java版本?這可能是重複的https://stackoverflow.com/questions/25713880/lein-repl-always-shows-connection-refused – schaueho

回答

8

有同樣的問題,可以通過運行一個無頭REPL,然後連接到它在另一個shell來解決

> lein repl :headless 
nREPL server started on port 9991 on host 127.0.0.1 - nrepl://127.0.0.1:9991 

然後在另一殼牌

> lein repl :connect nrepl://127.0.0.1:9991