簡體   English   中英

Travis CI - knitr 和依賴項

[英]Travis CI - knitr and dependencies

我將 travis 用於我的 package 用於 CI。 我在 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

有什么建議么?

R 需要安裝knitr來構建包。 也許您的基本環境中缺少這個 package(我不熟悉 travis)。

您能否添加一個明確安裝它的步驟,例如

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

我已經手動添加了安裝所有依賴項。 然后問題是沒有安裝devtools所以我也添加了。

這被添加到 travis yml

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

祝你好運

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM