Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't load X11 in R after OS X Yosemite upgrade

Running into the following error when I try to use ggplot2 and plot within the console after upgrading to Yosemite:

Error in (function (display = "", width, height, pointsize, gamma, bg,  :    X11 module cannot be loaded In addition: Warning message: In (function (display = "", width, height, pointsize, gamma, bg,  :   unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so':   dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 6): Library not loaded: /usr/X11/lib/libSM.6.dylib   Referenced from: /Library/Frameworks/R.framework/Resources/modules//R_X11.so   Reason: image not found 

How can I go about resolving this?

like image 291
raynach Avatar asked Oct 21 '14 15:10

raynach


People also ask

Why can't I forward X11 on my Mac?

For this reason, X11 forwarding is subjected to X11 SECURITY extension restrictions by default. Please refer to the ssh -Y option and the ForwardX11Trusted directive in ssh_config (5) for more information. The main advantage of using xterm instead of the built-in Terminal app is that xterm works without rebooting your Mac.

How do I update my Mac OS to High Sierra?

The App Store only shows updates for the OS you are using at the moment, in your case Yosemite 10.10.5. If you want to go to another newer OS that is called an upgrade. This can be done through the App Store using the following link. High Sierra is the last/ newest OS your Mac can use.

Can my 2014 MacBook Air upgrade to OS X El Capitan?

If your Mac isn't supported still, you could still upgrade to OS X El Capitan. Download the update from the App Store. The Mac App Store is the best, and usually only, place to download macOS updates. Be careful downloading update files from other sources. your 2014 MacBook Air can upgrade to all these below read the following links.

How do I update my Mac to OS X El Capitan?

If your Mac isn't supported still, you could still upgrade to OS X El Capitan. Download the update from the App Store. The Mac App Store is the best, and usually only, place to download macOS updates. Be careful downloading update files from other sources. You can download macOS High Sierra 10.13.6 here: Get macOS High Sierra


2 Answers

It looks like the OS update deleted the /usr/X11 and /usr/X11R6 symlinks. Please just re-install XQuartz from http://xquartz.macosforge.org which will setup the symlinks again for you.

like image 82
Jeremy Huddleston Sequoia Avatar answered Oct 18 '22 01:10

Jeremy Huddleston Sequoia


Execute the following in a terminal window:

locate libSM.6.dylib 

or do it from an R console:

system("locate libSM.6.dylib") 

On my Yosemite install it's in /opt/X11/lib/libSM.6.dylib.

If your setup is similar, then:

sudo ln -s /usr/X11 /opt/X11  

should help fix this temporarily, but I'd keep looking for a Yosemite R package (since that will accommodate all the changes Apple made to the filesystem structure).

like image 41
hrbrmstr Avatar answered Oct 18 '22 02:10

hrbrmstr