RStudio project “cannot find the file specified” on R session restart

前端 未结 3 906
天命终不由人
天命终不由人 2021-01-17 23:16

I am getting strange and annoying behavior in one (yes, only one) of my RStudio projects. Whenever I restart the R session within this project, I can no longer save any of t

相关标签:
3条回答
  • 2021-01-17 23:42

    This was happening to me as well, but curiously only when I was using Project files (.Rproj - not stand alone R scripts). It was driving me crazy.

    I found that buried in the settings (Tools -> Global Options -> Git/SVN) there was a setting "Enable Version Control Interface for RStudio Projects). I guess I had turned that option on when I was messing with my settings and then forgot about it since I don't normally use project files.

    0 讨论(0)
  • 2021-01-17 23:49

    I think @Jack Wasey is right: Google drive locks files during sync. This causes many issues with other programs as well. There are alternatives from companies that do file syncing for a living, such as dropbox, whose clients don't lock files. With google drive you only have the option to use selective sync and exclude every .Rproj.user folder. Once the RStudio's database is corrupted, moving the project out of the Google drive folder won't be enough - you will need to delete/rename it to have RStudio fix its database.

    Summary:

    1. Copy contents from all unsaved files to a temp file outside of RStudio (while clicking away the error message every other second)
    2. Quit Rstudio
    3. Pause Google drive syncing
    4. Rename (or move/delete) the hidden .Rproj.user folder in your project
    5. Reopen the project in Rstudio
    6. Exclude the new .Rproj.user folder from syncing with Google drive (Preferences -> sync only these folders)
    7. Remember that Google drive is free / Become an awesome google developer and fix the issue once and for all
    0 讨论(0)
  • 2021-01-17 23:56

    May not be related but might be helpful to someone else. I was getting the same error (over and over) and finally realized that I had an R session open from days ago, that had eventually gotten stuck. It was running in the background with a "Fatal Error" message waiting for me to click OK. When I closed that session everything started working again.

    0 讨论(0)
提交回复
热议问题