Bundy
Bundy

Reputation: 231

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

enter image description here

Upvotes: 23

Views: 28345

Answers (4)

vmorusu
vmorusu

Reputation: 936

To add to all above info, with recent releases of MacOS we will have to install XQuartz before installing R. After these installations, proceed with RStudio installation.

Upvotes: 1

RyanAbnavi
RyanAbnavi

Reputation: 378

You have probably installed Rstudio before installing R. What you can do is to first install R using brew install R and then reinstalling Rstudio using brew reinstall rstudio.

Upvotes: 9

Teddy C
Teddy C

Reputation: 1016

Running brew install R solves the problem for me.

Upvotes: 33

Tomerikoo
Tomerikoo

Reputation: 19431

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.
  • Then download R Studio for MacOS from here.

Upvotes: 10

Related Questions