6

I opened a file on the remote machine, and typed C-u M-! and then typed tree command. It showed in the buffer:

/bin/sh: tree: command not found

The tree command is installed into /home/RNAer/bin, and I verified it can run successfully when login with bash terminal.

Then I added the path in the .emacs like the following and restart emacs,

(add-to-list 'tramp-remote-path "/home/RNAer/bin")

but it still has the same error of command not found. what's the problem?

Charles
  • 50,943
  • 13
  • 104
  • 142
RNA
  • 146,987
  • 15
  • 52
  • 70
  • Where did you add `/home/RNAer/bin` to `$PATH` on the remote machine? In other words, is this directory also added to `$PATH` in **non-interactive** shell sessions? –  Feb 19 '13 at 15:09
  • It is added to `~/.bashrc` (which is sourced by `~/.bash_profile`), in the interactive shell. But I tested it - even if I add to the $PATH in non-interactive shell session, it still failed. – RNA Feb 19 '13 at 18:07
  • Did you remove your persistency file? (By default the persistency file is `~/.emacs.d/tramp`) – Roun Jun 22 '14 at 05:17

1 Answers1

0

I had the same problem, I solved by adding the following lines to .emacs

(require 'tramp) 
(add-to-list 'tramp-remote-path "/home/RNAer/bin")

Note that without first line the second line throws error. You could double check your tramp-remote-path by

(message (format "%s" tramp-remote-path))

to see if your path is set correctly.

user40129
  • 763
  • 1
  • 5
  • 15