Closed ikirill closed 9 years ago
I checked that running the command directly in a shell starts the julia process,
What shell? Emacs shell?
ESS is waiting for prompt from julia process. And it looks like it is not getting it. There were problems in the past with julia not working inside emacs. Make sure the remote has the most recent julia installed.
If julia works in emacs shell, there is no reason it should not work under ESS.
What shell? Emacs shell?
Sorry, I meant that I ran it outside emacs, with iTerm2 and ssh.
ESS is waiting for prompt from julia process. And it looks like it is not getting it. There were problems in the past with julia not working inside emacs. Make sure the remote has the most recent julia installed.
Does ESS hang when it doesn't get a prompt or show an error message? What should I expect to see?
Does ESS hang when it doesn't get a prompt or show an error message? What should I expect to see?
It hangs when julia does not show the prompt. Ssh into remote server from emacs shell or run shell through tramp. Then call invoke jullia from inside that shell. If that works then ESS should work.
I am installing julia on my server now. When it had installed I will try it myself to see if ESS works with the most recent julia.
Running julia with ssh
, starting julia
by hand, then using ess-remote
works fine, though.
Ok. That's strange. Let's see if I can reproduce the problem. Still compiling.
Maybe not relevant, but running eshell
, then inside that ssh remote-server
, then julia
, then ess-remote
, then typing "1 + 2" and hitting enter, gives me:
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
comint-send-input()
inferior-ess-send-input()
funcall-interactively(inferior-ess-send-input)
call-interactively(inferior-ess-send-input nil nil)
command-execute(inferior-ess-send-input)
Ok. I can reproduce, but I am not sure it's the same problem. After M-x julia
and C-g
. go to *julia*
buffer and see what's there. Mine shows:
env: julia: No such file or directory
Process julia exited abnormally with code 127 at Fri Jan 16 10:44:58 2015
That is tramp cannot find julia executable.
This is what I have to fix this in my .emacs file:
(eval-after-load 'tramp-sh
'(setq tramp-remote-path
(append '("/home/vspinu/bin"
"/home/churn/bin") tramp-remote-path)))
This is exactly the right problem, I see the same *julia*
buffer (I didn't notice it existed).
Do you know why tramp doesn't read .bashrc or .profile? If I ssh separately, it definitely reads the configuration files, because it can find julia executable just fine. I suppose R is just installed in some standard location.
Changing tramp-remote-path to add the path to julia doesn't seem to do anything, I added "full/path" as well as "~/path".
If I open /ssh:remote:
, run M-x eshell
, and then echo $PATH
, I get my (local) OSX path. If I add the remote julia path to my local path (with setenv "PATH"
), running M-x julia
with the remote server still doesn't work.
Changing tramp-remote-path to add the path to julia doesn't seem to do anything, I added "full/path" as well as "~/path".
Works for me. Should also work for you. Have you restarted emacs. For some reason that's needed.
If I ssh separately, it definitely reads the configuration files, because it can find julia executable just fine.
When julia/R are invoked it's not run from a bash shell but rather directly. So your rcs are not executed. I don't know the specific details though.
Have you restarted emacs. For some reason that's needed.
It works now, that fixed it. Thank you very much.
When julia/R are invoked it's not run from a bash shell but rather directly. So your rcs are not executed. I don't know the specific details though.
My impression is that tramp interacts with a shell (see the tramp-send-command in my first post, that is definitely a shell command), and I expected it to read at least something (I put PATH into both .bashrc and .profile just in case, and there is no .bash_profile).
I also found this: https://www.gnu.org/software/emacs/manual/html_node/tramp/Remote-shell-setup.html (search for ~/.profile
on that page).
My impression is that tramp interacts with a shell (see the tramp-send-command in my first post, that is definitely a shell command), and I expected it to read at least something (I put PATH into both .bashrc and .profile just in case, and there is no .bash_profile).
Hm. That indeed makes sense. I have no idea. But it's pretty certain that .bashrc, .profile or .bash_profile are not loaded by tramp shell. I would be interested to know what's going on.
Okay, I found this: https://www.gnu.org/software/emacs/manual/html_node/tramp/Remote-Programs.html
The right way to solve this is by doing this:
(with-eval-after-load 'tramp-sh
(add-to-list 'tramp-remote-path 'tramp-own-remote-path))
Here tramp-own-remote-path
tells tramp to load the path from remote configuration files. It's quite easy to get burned by this.
Is this a problem for ESS? I'm not sure, but since R inherits path from environment, might this be a problem for executing code remotely that invokes other executables (with system
, for example)?
I was trying to start a remote julia process by asking for working directory to be /ssh:remote-server: and ESS hanged; this doesn't happen with the same remote server when running R.
Backtrace:
The last line of tramp's debugging output (with tramp-verbose = 6) is
The
*ESS*
buffer looks like this:I checked that running the command directly in a shell starts the julia process, and I also checked that running R in the same way (with the same remote server) starts an R session correctly.