본문 바로가기
프로그래밍/환경 구축 및 기타

004.[vscode]R terminal 오류: cannot open file '/home/~/.vscode-server/extensions/reditorsupport.r-2.8.3/R/session/init.R': No such file or directory

by life_is_egg 2024. 5. 20.
반응형

 

에러 상황

vscode를 열자마자 OUTPUT 창에서 아래와 같은 에러가 뜸.

R Language Server (3016) started
Loading required package: httpgd

Error in file(filename, "r", encoding = encoding) : 
  cannot open the connection
Calls: local ... eval.parent -> eval -> eval -> eval -> eval -> source -> file
In addition: Warning message:

In file(filename, "r", encoding = encoding) :
  cannot open file '/home/hmgil/.vscode-server/extensions/reditorsupport.r-2.8.3/R/session/init.R': No such file or directory
Execution halted

R Language Server (3016) exited with exit code 1

 

vscode에서 R terminal 연결을 하니까 똑같은 에러가 뜨면서 연결이 안 됨.

Error in file(filename, "r", encoding = encoding) : 
  cannot open the connection
In addition: Warning message:
In file(filename, "r", encoding = encoding) :
  cannot open file '/home/hmgil/.vscode-server/extensions/reditorsupport.r-2.8.3/R/session/init.R': No such file or directory

 

 

에러 해결

(결론) .Rprofile 파일의 local(source(~~~)) 내의 경로를 찾아 다시 맞게 수정하면 됨.

 

Rprofile (경로: /home/.Rprofile) 파일을 열면 나는 아래와 같이 적혀있음.

R을 열 때 곧바로 실행되는 파일이라고 이해하면 되는데, 두 번째 행을 실행시킬 때 에러가 뜨는 것임.

 

 

두번째 행에 적힌 경로를 따라 들어가니까 "reditorsupport.r-2.8.3"이 아닌

"reditorsupport.r-2.8.4"로 폴더명이 바뀌어 있었음.

정확하지 않지만 추측해 보면 버전이 업그레이드된 것 같음.

require("httpgd")
local(source("/home/.vscode-server/extensions/reditorsupport.r-2.8.3/R/session/init.R", chdir = TRUE, local = TRUE))

 

 

경로명을 맞게 다시 수정만 해주면 정상적으로 돌아감!

반응형

댓글