unable to load shared object '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/glue/libs/glue.so'

After updating to the latest version of Rstudio I got error when loading 'ggplot2'. My error message is like:

Error: package or namespace load failed for ‘ggplot2’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/glue/libs/glue.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.2/Resources/library/glue/libs/glue.so, 0x0006): Library not loaded: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/4.2/Resources/library/glue/libs/glue.so
Reason: tried: '/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib' (no such file), '/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, not in dyld cache)

To help diagnostic:

> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Ventura 13.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] emulator_1.2-21 mvtnorm_1.1-3  

loaded via a namespace (and not attached):
 [1] digest_0.6.29    grid_4.2.1       R6_2.5.1         lifecycle_1.0.3  gtable_0.3.1    
 [6] scales_1.2.1     rlang_1.0.6      rstudioapi_0.14  vctrs_0.5.1      tools_4.2.1     
[11] munsell_0.5.0    compiler_4.2.1   colorspace_2.0-3
> R.version
platform       x86_64-apple-darwin17.0     
arch           x86_64                      
os             darwin17.0                  
system         x86_64, darwin17.0          
major          4                           
minor          2.1                         
year           2022                        
month          06                          
day            23                          
svn rev        82513                       
language       R                           
version.string R version 4.2.1 (2022-06-23)
nickname       Funny-Looking Kid 

Is that a version-specific bug? Thanks in advance for any clue!

If this is not in .libpaths(), it’s likely that R was installed as a local user, rather than as a system-level program. What does it show? There’s been a lot of this going round.

Hi, thanks for your reply. I didn't get your question - libpaths()seems not to be a function.
Actually, in addition to ggplot2, lots of other packages had similar loading problem, including field, sf, raster, etc. (Yes, mostly related to spatial analysis and plotting)

Since I'm in hurry to complete some tasks and have no time for troubleshooting right now, I simply restored back to the previous version (RStudio-2022.07.1-554) and the problem disappreared.

My bad, it's an oddball that begins with a dot— .libPaths().

I get it! It shows


As "technocrat" noted, there seems to be a lot of this going around. See my post:

The question is why does the shared object file "glue.so" reference the wrong dylib? Can the shared object file be edited?

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.