【发布时间】:2020-01-27 20:20:22
【问题描述】:
我在 Mac osx 10.11.6 (El Capitan) 上运行 R 3.6.0 并在通过 system() 调用 Rscript 时收到“致命错误:为 '-e' 创建临时文件失败”错误。
test_cmd <- "/Library/Frameworks/R.framework/Resources/bin/Rscript -e 'print(\"Hello\")'"
system(test_cmd, intern = TRUE)
返回此错误:
[1] "Fatal error: creating temporary file for '-e' failed"
attr(,"status")
[1] 2
Warning message:
In system(test_cmd, intern = TRUE) :
running command '/Library/Frameworks/R.framework/Resources/bin/Rscript -e 'print("Hello")'' had status 2
我在尝试通过未来创建集群时遇到此错误,这使我想到了这个特定的示例。
future::makeClusterPSOCK(1, outfile = NULL, verbose = TRUE)
这也调用 Rscript 并失败并出现相同的错误。
另外,如果我从命令行调用 Rscript,它运行良好。
【问题讨论】:
-
在终端和 macOS 10.14.6 上的 R.app 中与 R 3.6.1 一起正常工作。