r-Travis CI-编织者和依赖关系



我正在为CI的包使用travis。我在R发布版本(devel版本(的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 .

关于发布版本上的错误,我在DESCRIPTION文件中指定了Suggests:knifer和VignetBuilder:knifer
我不理解devel版本上的错误。这似乎是TRAVIS上的一个错误。

以下是travis yml文件中的设置:

language: R
sudo: false
cache: packages
warnings_are_errors: true
os:
- linux
- osx
r:
- oldrel
- release

有什么建议吗?

R需要安装knitr才能构建包。也许这个包在您的基本环境中丢失了(我不熟悉travis(。

你可以添加一个步骤来明确安装它吗,比如

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

我手动添加了install所有依赖项。然后问题是没有安装devtools,所以我也添加了它。

这被添加到travis yml 中

install:
- R -e 'install.packages("devtools")'
- R -e 'devtools::install_deps(dep = T)'

祝好运

最新更新