RStudio will not create a new script or open any existing scripts

RStudio no longer allows me to create new scripts (either using the file menu, icon or shortcut), nor will it open any existing scripts, instead providing the error message "no such file or directory".

I've tried uninstalling and re-installing RStudio, but the problem persists.

System Information:


@adamjclee Is your folder from which you are trying to access the scripts a mapped network drive? I faced a similar issue while working on mapped drives. Best way to check this is try reading scripts from /home/~ folder and see if the problem persists.

Thanks!
Heramb

Thanks for the idea - but no, it's just a regular folder under /home/... However, I have now realised it's a permissions issue. If I open rstudio as root, it works fine. Not sure exactly what has the wrong permissions yet, nor how to solve it, but it's some progress!

2 Likes

@adamjclee This can be an issue with versions of RStudio later than 1.1.456. I am running the RStudio-1.2.1070 preview release. To be sure, if you could try installing RStudio-1.1.456 and then try accessing the files. If you are able to do so, a query can be raised on RStudio support. I have many colleagues using previous versions and they do not have problem opening R-scripts from any location. Also, I tried to open a script from R-3.5.1 - gui.exe and it worked well. So this is definitely a RStudio issue.

Thanks!
Heramb

FYI: I am on Windows environment

1 Like

You might want to check permissions in these folders:

  • ~/.rstudio-desktop
  • <projDir>/.Rproj.user

RStudio uses these folders for local state. If they (or the files within) are owned by root, then RStudio might not be able to read / write within those folders and operations like this may fail.

Thanks for the tip. I don't have any projects at the moment, so I don't think the second applies. I've just checked the permissions in the ~/.rstudio-desktop folder, and it doesn't look like there's any problem there: none of the files appear to be owned by root.

You might also check the permissions on your AppData folders (e.g. %APPDATA%, %LOCALAPPDATA%) since RStudio will attempt to write some state-related information there on file save, etc.

Hello,

I experienced the very same issue as the OP. For me, the problem was with the permissions in the .rstudio-desktop/sources/s-[sequence of numbers and letters] folder. This was owned by root, but when I changed permissions it resolved the problem.

sudo chmod a+rwx s-[sequence]

2 Likes

I had the same problem and this worked for me. Thanks!