gpt4 book ai didi

emacs - 如何使 nrepl-ritz-jack-in 通过 TRAMP/Emacs 远程工作

转载 作者:行者123 更新时间:2023-12-03 04:01:05 24 4
gpt4 key购买 nike

我想要什么:

我在远程站点上有一个 clojure 程序,我们称之为 mccarthy 。我想做的是连接到 nrepl-ritz从我的笔记本电脑,最好使用 nrepl-ritz-jack-in 。插孔对于本地程序工作正常,但似乎无法连接到远程程序。

尝试 1

C-x C-f/mccarthy:code/program/project.clj

(require 'nrepl-ritz)

M-x nrepl-ritz-jack-in

结果

Emacs 似乎挂起。如果我去*nrepl-server*缓冲区,我看到这个:

Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.flatland.drip.Main.invoke(Main.java:117)
at org.flatland.drip.Main.start(Main.java:88)
at org.flatland.drip.Main.main(Main.java:64)
Caused by: java.lang.AssertionError: Assert failed: project
at leiningen.ritz_nrepl$start_jpda_server.invoke(ritz_nrepl.clj:23)
at leiningen.ritz_nrepl$ritz_nrepl.doInvoke(ritz_nrepl.clj:95)

(还有大量其他行...)

我正在使用drip在我的笔记本电脑上,但不在 mccarthy 上,如此清楚nrepl-ritz-jack-in没有检测到它是远程文件。常规老nrepl-jack-in然而,在这种情况下将按预期工作。

尝试 2

我还尝试启动 nrepl-ritz使用leinmccarthy :

mattox@mccarthy$ lein ritz-nrepl
nREPL server started on port 42874

从我的笔记本电脑我转发了一个本地端口 42874连接到42874mccarthy :

ssh -L 42874:localhost:42874 -N mccarthy

然后,从我本地的 Emacs:

(require 'nrepl-ritz)

M-x nrepl

主持人:127.0.0.1

端口:42874

这给了我一个联系:

; nREPL 0.1.7-preview
user>

为了测试它,我运行了

M-x nrepl-ritz-threads

它给了我一个很好的线程表。

M-x nrepl-ritz-break-on-exception

user> (/ 1 0)

结果

这会挂起,但有时会显示隐藏的调试缓冲区,并且可以进行一些重新启动。如果我告诉它将异常传递回程序,它永远不会将控制权交还给 REPL。

我已经进行了大量搜索,但无法获得比“确保 lein 在您的路径上”更具体的内容(我确实在两台机器上都这样做了......)。

最佳答案

If the repl is still running from the previous cider-jack-in, you should either use the cidercommand to connect to the running instance, or stop the previous before starting a new one

从这里开始` Clojure - connection issue re-running cider-jack-in

另请参阅此https://devcenter.heroku.com/articles/debugging-clojure

关于emacs - 如何使 nrepl-ritz-jack-in 通过 TRAMP/Emacs 远程工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15330810/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com