Error: unable to load R code in package 'graphics' when compiling R 3.6.0 on Linux

Error: unable to load R code in package 'graphics' when compiling R 3.6.0 on Linux

我在 bitbucket 管道中的 amazonlinux:2018.03.0.20190212 docker 图像上构建 R 时遇到错误。奇怪的是,如果我 运行 一个 EC2(Amazon Linux 2018),我可以 运行 完全相同的命令而不会出错。

有人知道怎么解决吗?

make[6]: Entering directory `/opt/R/src/library/graphics/src'
mkdir -p -- ../../../../library/graphics/libs
make[6]: Leaving directory `/opt/R/src/library/graphics/src'
make[5]: Leaving directory `/opt/R/src/library/graphics/src'
make[4]: Leaving directory `/opt/R/src/library/graphics'
make[4]: Entering directory `/opt/R/src/library/graphics'
byte-compiling package 'graphics'
Error : .onLoad failed in loadNamespace() for 'utils', details:
  call: system(paste(which, shQuote(names[i])), intern = TRUE, ignore.stderr = TRUE)
  error: error in running command
Error: unable to load R code in package 'graphics'
Execution halted

手动,在 EC2 上:

make[6]: Leaving directory `/opt/R/src/library/graphics/src'
make[5]: Leaving directory `/opt/R/src/library/graphics/src'
make[4]: Leaving directory `/opt/R/src/library/graphics'
make[4]: Entering directory `/opt/R/src/library/graphics'
byte-compiling package 'graphics'
make[4]: Leaving directory `/opt/R/src/library/graphics'
make[3]: Leaving directory `/opt/R/src/library/graphics'
make[3]: Entering directory `/opt/R/src/library/stats'
building package 'stats'

我对 R 不太熟悉,也没有发现错误消息特别有用。

我遇到了同样的问题,但不是 Docker 而是 Singularity。对我来说,结果是我从容器中丢失了 'which' 二进制文件。安装 'which' 软件包后(我在 CentOS7 上),我能够通过那个错误。