[Tip] Emacs: rust-analyzer-tramp가 계속 죽는 문제

Remote server에 tramp mode로 rust file을 읽어서 rust-mode에 진입한 후에 미니버퍼에 아래와 같은 경고가 뜨는데, ‘y’를 입력해서 rust-analyzer-tramp를 재실행 시켜도 계속해서 죽어서 같은 오류가 보이는 문제가 생겼다.

rust-analyzer 설치 확인

Remote server측에 rust-analyzer가 설치되어 있지 않으면 이와 같은 문제가 생길 수 있으니 다음의 명령어로 rust-analyzer를 update해본다. 만약 설치 되어 있지 않다면 이 과정에서 설치될 것이다.

rustup component add rust-analyzer

Remote path 사용

rust-analyzer가 이미 설치 되어 있음에도 문제가 발생 한다면 서버측의 path가 제대로 설정되고 있는지 확인해 보자. Trump mode는 서버측의 PATH 환경변수 값 을 읽지 않으므로 경로정보를 서버의 것으로 유지 하도록 설정해 주어야 한다.

 (require 'tramp)
 (setq tramp-default-method "ssh")
 ;; Respect remote path.
 (with-eval-after-load 'tramp
   (add-to-list 'tramp-remote-path 'tramp-own-remote-path))