Creating and rebooting in RStudio generates a "Save file" error

I am working on an Rcpp-enabled R-package as a project in RStudio (version 1.0.136, Ubuntu 16.04 64 bit) and have recently started receiving an error message after creating the package using Tools> Build and Reboot. Error dialog box:

Save File No such file or directory 

The error occurs immediately after the build and reboot. Rather, this happens some time later, making changes to files that seem random, and not necessarily when trying to save. However, after closing the dialog box, the files cannot be saved without generating another error, this time with the message:

 Error Saving File No such file or directory 

After that, the only way forward is to restart RStudio without saving any files, thereby losing all changes.

The problem does not seem to be related to either roxygen2 or devtools, since I tried to build using the Generate documentation using the Roxygen and Use devtools functions in Tools> Project Settings> Build Tools. I also tried uninstalling and installing RStudio, as well as updating devtools, etc., but the problem persists. I am wondering if this is a problem in one of the package files such as NAMESPACE or DESCRIPTION. The package repository is available at https://github.com/shaunpwilkinson/insect .

+6
source share
3 answers

I myself ran into this error, and I'm posting something that seemed to work based on a Shaun comment and a post on the RStudio support website.

The error is not limited to creating a package; I came across this while working in a standard RStudio project.

I found this comment from RStudio support here :

I think if you clear the sdb directory (source data) inside ~ / .rstudio, then this can make things work for now.

So, I closed RStudio, went into the terminal and deleted the entire .RStudio.user subdirectory (inside the project directory, which is not what is directly stated above). I restarted RStudio and voila. It works, and RStudio recreated the .RStudio.user directory.

ATTENTION: this will delete all unsaved data, including the contents of your environment and any unsaved files. Before using this hotfix, copy the contents of unsaved files to another text editor.

In the future I will use RStudio 1.0.143 on OS / X 10.12.5.

+5
source

I had the same problem but could not find the mentioned sdb directory. It may be very obvious, but just everything you need and reinstalling also works. I suffered a lot from such problems when I was a beginner and did not understand what I should do in many cases, so here are all the steps in case the beginner comes here:

First, delete R. Then on the terminal

 sudo rm -rf ~/.rstudio sudo rm ~/.Rhistory # probably redundant 

Then install it again.

0
source

According to [1]: this usually implies that for some reason your user account does not have write permissions to the folder on ~ / .rstudio-desktop (or ~ / .rstudio for RStudio Server).

Decision:

sudo chown -R $ (whoami) ~ / .rstudio *

[1] https://github.com/rstudio/rstudio/issues/2037

0
source

Source: https://habr.com/ru/post/1015327/


All Articles