Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I make nrepl-ritz-jack-in work remotely over TRAMP / Emacs
    text
    copied!<h2>What I want:</h2> <p>I have a clojure program on a remote site, let's call it <code>mccarthy</code>. What I want to do is connect to a <code>nrepl-ritz</code> from my laptop, preferably using <code>nrepl-ritz-jack-in</code>. The jack in works fine for a local program, but doesn't seem to connect to a remote program.</p> <h2>Attempt 1</h2> <p><kbd>C-x C-f</kbd> on <code>/mccarthy:code/program/project.clj</code></p> <p><code>(require 'nrepl-ritz)</code></p> <p><kbd>M-x</kbd> <code>nrepl-ritz-jack-in</code></p> <h2>Result</h2> <p>Emacs appears to hang. If I go to the <code>*nrepl-server*</code> buffer, I see this:</p> <pre><code>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) </code></pre> <p>(and tons of other lines, too...)</p> <p>I am using <code>drip</code> on my laptop, but not on <code>mccarthy</code>, so clearly <code>nrepl-ritz-jack-in</code> is not detecting that it's a remote file. Regular old <code>nrepl-jack-in</code> will work as expected in this case, however.</p> <h2>Attempt 2</h2> <p>I also tried starting an <code>nrepl-ritz</code> using <code>lein</code> on <code>mccarthy</code>:</p> <pre><code>mattox@mccarthy$ lein ritz-nrepl nREPL server started on port 42874 </code></pre> <p>From my laptop I forward a port so local <code>42874</code> connects to <code>42874</code> on <code>mccarthy</code>:</p> <pre><code>ssh -L 42874:localhost:42874 -N mccarthy </code></pre> <p>Then, from my local Emacs:</p> <pre><code>(require 'nrepl-ritz) </code></pre> <p><kbd>M-x</kbd> <code>nrepl</code></p> <p>Host: <code>127.0.0.1</code></p> <p>Port: <code>42874</code></p> <p>This gives me a connection:</p> <pre><code>; nREPL 0.1.7-preview user&gt; </code></pre> <p>So to test it out, I run</p> <p><kbd>M-x</kbd> <code>nrepl-ritz-threads</code></p> <p>It gives me a nice table of threads.</p> <p><kbd>M-x</kbd> <code>nrepl-ritz-break-on-exception</code></p> <pre><code>user&gt; (/ 1 0) </code></pre> <h2>Result</h2> <p>This hangs, but sometimes shows a hidden debugging buffer with some restarts available. If I tell it to pass the exception back to the program, it never gives control back to the REPL.</p> <p>I've done plenty of searches but have not been able to get anything more specific than "make sure lein is on your path" (And I did do that, on both machines...).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload