I just updated MacOS Catalina (10.15.2) and I'm having lots of troubles to use RStudio again with normality.
When I open the project this appears:
Error attempting to read history from ~/Desktop/.Rhistory: permission denied (is the .Rhistory file owned by root?)
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
WARNING: Failed to restore workspace from '~/Desktop/.RData'
Reason: cannot open the connection
And when I try to "Run App" I get this:
Warning in readLines(file, warn = FALSE) :
cannot open file '/Users/project_name.R': Operation not permitted
Error in readLines(file, warn = FALSE) : cannot open the connection
Do you know what can be happening? I'm really stuck with this
Please help me!
Thank you so much in advance!
Catalina has new security rules that limit applications' access to a number of folders (including Desktop and some other folders under (or all of?) /Users). Typically, you're prompted to grant access to the folders when the application is trying to access them. If you're not seeing those pop-ups, you might go to System Preferences -> Security & Privacy -> Files and Folders and add RStudio and the relevant folders there. Failing that, a reinstall of RStudio might trigger the prompts.
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: