问题
I recently started using CIDER under Emacs 24. My workflow involves going to a remote server via Tramp and then executing cider-jack-in
to run the nREPL server connected to Clojure on that server. It all works fine if I run it in a fresh instance of Emacs. But if for some reason the connection is broken or I hibernate the system, I am unable to relaunch the REPL. I get the following message:
Connecting to nREPL on localhost:58062...
error in process filter: open-network-stream: make client process failed: connection refused, :name, nrepl, :buffer, *nrepl-connection clojure-koans*<3>, :host, localhost, :service, 58062, :nowait, nil
error in process filter: make client process failed: connection refused, :name, nrepl, :buffer, *nrepl-connection clojure-koans*<3>, :host, localhost, :service, 58062, :nowait, nil
I suspect it has something to do with the connection port being still held up by the previous instance, especially since the new connection attempt is on the same port number. Is there a simple way to free the previously used port altogether and/or force CIDER to attempt on a different port? Maybe you have other suggestions for using CIDER for remote work. Any help greatly appreciated.
回答1:
If the repl is still running from the previous cider-jack-in
, you should either use the cider
command to connect to the running instance, or stop the previous before starting a new one.
来源:https://stackoverflow.com/questions/22908315/clojure-connection-issue-re-running-cider-jack-in