Error reading R script (),system error 2 when trying to run R Studio on Mac
I installed R Studio desktop in my MacBook air running on Big Sur. Unfortunately, it cannot run due to the error below:
Error reading R script (),system error 2 (No such file or directory); Unable to find libR.dylib in expected locationswithin R Home directory /Library/Frameworks/R.framework/Resources
Solution 1:
Running brew install R
solves the problem for me.
Solution 2:
A similar question was asked on the R Studio community.
-
You need to first download base R:
- Choose the latest version from here, under the Latest release header. For example,
R-4.1.0.pkg
.
- Choose the latest version from here, under the Latest release header. For example,
-
Then download R Studio for MacOS from here.