首页 > 解决方案 > Travis CI - knitr 和依赖项

问题描述

我正在为我的 CI 包使用 travis。我在 R 发行版和开发版的 Mac 上遇到错误。这些是我得到的错误:

在发布版本上:

Error in loadVignetteBuilder(pkgdir, TRUE) : 
  vignette builder 'knitr' not found
Execution halted
The command "R CMD build  ." failed and exited with 1 during .
Your build has been stopped.

在开发版本上:

Installing packages into ‘/Users/travis/R/Library’
(as ‘lib’ is unspecified)
Error: (converted from warning) unable to access index for repository https://cloud.r-project.org/bin/macosx/el-capitan/contrib/4.0:
  cannot open URL 'https://cloud.r-project.org/bin/macosx/el-capitan/contrib/4.0/PACKAGES'
Execution halted
The command "Rscript -e 'deps <- remotes::dev_package_deps(dependencies = NA);remotes::install_deps(dependencies = TRUE);if (!all(deps$package %in% installed.packages())) { message("missing: ", paste(setdiff(deps$package, installed.packages()), collapse=", ")); q(status = 1, save = "no")}'" failed and exited with 1 during .

关于发布版本的错误,我在说明文件中指定了 Suggests: knitr 和 VignetteBuilder: knitr 。
开发版的错误我不明白。这似乎是 TRAVIS 上的一个错误。

这些是 travis yml 文件中的设置:

language: R
sudo: false
cache: packages
warnings_are_errors: true

os:
  - linux
  - osx

r:
  - oldrel
  - release

有什么建议么?

标签: rtravis-cir-package

解决方案


需要安装 Rknitr来构建包。也许你的基础环境中缺少这个包(我不熟悉 travis)。

您能否添加一个明确安装它的步骤,例如

R -e 'install.packages("knitr")'

推荐阅读