After updating RStudio I am receiving the following message when trying to load packages. The error below is specific to ggplot2 but the same thing happens no matter what package I'm trying to load.
Error: package or namespace load failed for ‘ggplot2’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/barrylesht/Library/R/x86_64/4.2/library/glue/libs/glue.so':
dlopen(/Users/barrylesht/Library/R/x86_64/4.2/library/glue/libs/glue.so, 0x0006): Library not loaded: '/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib'
Referenced from: '/Users/barrylesht/Library/R/x86_64/4.2/library/glue/libs/glue.so'
Reason: tried: '/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib' (no such file), '/usr/local/lib/libR.dylib' (no such file), '/usr/lib/libR.dylib' (no such file)
For some reason RStudio seems to be trying the 4.0 library instead of the 4.2 library. How can I fix this?
This arises from installationsof R—one under the user /Users/barrylesht/Library, which can happen with non-standard installations from brew or anaconda, for example, rather than the root /Library. Check to see if you have an installation under root and, if so, uninstall the User version. See if that works; if not try adjusting $PATH variable. Otherwise, download from CRAN and re-install, taking all the defaults.
Thanks, I appreciate your help, but I'm still confused. I don't use either brew or anaconda, rather used the installer downloaded from the "Posit" site. I just reinstalled both R and RStudio. However, here is what I see in the /Applications directory:
drwxr-xr-x 3 root wheel 96 Dec 19 14:11 R.app
drwxr-xr-x@ 3 barrylesht admin 96 Dec 3 21:28 RStudio.app
I'm not sure what you mean by adjusting the $PATH variable.
What you are seeing is in the Applications folder and relates to the RStudio GUI, only. LAPACK is part of R which isn't installed there but in Library/Frameworks/R.framework/Versions/4.0/Resources/lib/ , /usr/local/lib/libR.dylib' or '/usr/lib/libR.dylib. Could you have installed an x86_64 on a Silicon box? And if $PATH is not familiar, I'd advise against trying to follow the ln procedure above. It's easy to trip up.
I'm dead in the water until I get this fixed so I just restored the previous version or RStudio (the base R version is the same) and it works fine. Something must have gone wrong with the RStudio update. I hope we can figure that out.
Sorry for the confusion—I think that I conflated the two questions. Don't forget about the cloud version. I also have RStudio Server installed locally for use with tablets and situations like these.