RStudio 项目“找不到指定的文件"在 R 会话重新启动 [英] RStudio project "cannot find the file specified" on R session restart

查看:182
本文介绍了RStudio 项目“找不到指定的文件"在 R 会话重新启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的一个(是的,只有一个)我的 RStudio 项目中,我出现了奇怪且烦人的行为.每当我在此项目中重新启动 R 会话时,我无法再保存任何文件,并且当我尝试(或 RStudio 尝试自动)时,我收到一个弹出错误,提示系统找不到指定的文件",我有重新打开项目和所有 R 脚本.

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 the files, and when I try to (or RStudio tries to automatically) I get a popup error saying "The system cannot find the file specified" and I have to reopen the project and all of the R scripts.

我查看了日志文件,看到很多如下错误:

I looked at the log file, and I see a lot of the following error:

07 Oct 2015 00:52:05 [rsession-Mark] ERROR system error 5 (Access is denied) [path=C:/Users/Mark/GoogleDrive/Research/CEQUAL_event/.Rproj.user/5E5F98D9/sdb/s-26E44539/lock_file];
OCCURRED AT: bool rstudio::core::FilePath::exists() const C:\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:308;
LOGGED FROM: bool rstudio::core::FilePath::exists() const C:\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:308

问题似乎出在 .Rproj.user 文件夹中.所以我删除了它并让 RStudio 重新生成它,但行为又开始了.

It looks like the problem may be in the .Rproj.user folder. So I deleted that and let RStudio regenerate it, but the behavior started right back up again.

我使用的是 Windows 7、RStudio 版本 0.99.441 和 R 版本 3.2.2.

I am using Windows 7, RStudio version 0.99.441, and R version 3.2.2.

推荐答案

我认为 @Jack Wasey 是对的:Google 驱动器在同步期间锁定文件.这也会导致其他程序出现许多问题.以文件同步为生的公司有一些替代方案,例如 Dropbox,其客户端不锁定文件.使用 google drive,您只能选择使用选择性同步并排除每个 .Rproj.user 文件夹.一旦 RStudio 的数据库损坏,将项目移出 Google 驱动器文件夹是不够的 - 您需要删除/重命名它才能让 RStudio 修复其数据库.

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.

总结:

  1. 将所有未保存文件的内容复制到 RStudio 之外的临时文件中(同时每隔一秒点击一次错误消息)
  2. 退出 Rstudio
  3. 暂停 Google 云端硬盘同步
  4. 重命名(或移动/删除)项目中隐藏的 .Rproj.user 文件夹
  5. 在 Rstudio 中重新打开项目
  6. 排除新的 .Rproj.user 文件夹与 Google Drive 同步(首选项 -> 仅同步这些文件夹)
  7. 请记住,Google 云端硬盘是免费的/成为出色的 Google 开发者并一劳永逸地解决问题
  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

这篇关于RStudio 项目“找不到指定的文件"在 R 会话重新启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆