无法通过 Big Sur 上的开发工具安装 Bookdown

Unable to install Bookdown via devtools on Big Sur

正如标题所说,我无法在 macOS Big Sur 上通过 devtools 安装 Bookdown:

Downloading GitHub repo rstudio/bookdown@HEAD
Downloading GitHub repo rstudio/rmarkdown@HEAD
Installing 1 packages: tinytex
Installing package into ‘/usr/local/lib/R/4.0/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://lib.ugent.be/CRAN/src/contrib/tinytex_0.27.tar.gz'
Content type 'application/x-gzip' length 27492 bytes (26 KB)
==================================================
downloaded 26 KB

Error: (converted from warning) Setting LC_TIME failed, using "C"
Execution halted
Error: Failed to install 'bookdown' from GitHub:
  Failed to install 'rmarkdown' from GitHub:
  (converted from warning) installation of package ‘tinytex’ had non-zero exit status

我在启动 R 时收到类似的警告:

During startup - Warning messages:
1: Setting LC_COLLATE failed, using "C" 
2: Setting LC_TIME failed, using "C" 
3: Setting LC_MESSAGES failed, using "C" 
4: Setting LC_MONETARY failed, using "C" 

我的系统设置为美国英语。 locale 的输出是:

LANG=""
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

我在网上找到的建议是先 运行 defaults write org.R-project.R force.LANG en_US.UTF-8,但这对我来说没有任何改变。

似乎确实有效的解决方法是在启动 R(或 Rscript)时显式设置 LC_ALL:

LC_ALL="en_US.UTF-8" R

在 R 本身中设置此设置无效。