我想在 iMac 上设置 rstudio-server,支持多用户和远程登录。我按照 INSTALL 中的步骤操作教程:我构建了源代码,设置了配置文件和 launchd 守护进程。起初,它工作正常,但一段时间后,我在绘图时收到这些警告/错误:
2022-06-09 08:02:29.438 rsession[3050:139329] XType: failed to connect - Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.fonts was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.fonts was invalidated: failed at lookup with error 3 - No such process.}
2022-06-09 08:02:29.438 rsession[3050:139329] Font server protocol version mismatch (expected:5 got:0), falling back to local fonts
2022-06-09 08:02:29.438 rsession[3050:139329] XType: unable to make a connection to the font daemon!
2022-06-09 08:02:29.438 rsession[3050:139329] XType: XTFontStaticRegistry is enabled as fontd is not available.
然后我无法再进行绘图,除非重新启动 R 并重新运行我的代码。你知道可能是什么问题吗?打开 issue on the rstudio-server github 时我无法获得任何帮助因为 MacOS 并未得到官方支持。
我也在考虑通过 docker 运行 rstudio-server,但我找不到将用户命名空间从 macOS 映射到容器的好方法。
任何帮助或建议将不胜感激!
编辑:看来我能够通过启动 fontd 守护进程来解决这个问题:
sudo launchctl load -w /System/Library/LaunchAgents/com.apple.fontd.useragent.plist
最佳答案
这似乎是 MacOS 字体守护程序的问题,而不是 RStudio 本身的问题。
有人报告了类似的issue在 PhantomJS 上。重新启动为他们解决了这个问题。
This answer对于不同的版本报告了相同的错误,他们能够通过在钥匙串(keychain)中安装正确的“Apple 全局开发者关系认证机构”来解决该错误:
The one I had had an expiration date of February 2023. I deleted that one and went here, downloaded the one called "Worldwide Developer Relations - G3 (Expiring 02/20/2030 00:00:00 UTC)", then retried the build and it worked.
关于r - 在 macOS 上设置 rstudio-server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73160433/