4
votes

I've been using travis-ci successfully so far but I'm having trouble when using travis-ci with R 3.4.0 at the vignette building step with the following error in the "building package" section:

* installing the package to build vignettes
* creating vignettes ... ERROR
Error in loadVignetteBuilder(vigns$pkgdir) : 
  vignette builder 'knitr' not found
Calls: <Anonymous> -> loadVignetteBuilder
Execution halted

When I run R-CMD-check locally it passes and I don't get any errors

Here's the current .travis.yml

language: R
sudo: false
install:
  - R -e "0" --args --bootstrap-packrat
cache:
  directories:
    - $TRAVIS_BUILD_DIR/packrat/src
    - $TRAVIS_BUILD_DIR/packrat/lib
  packages: true

r_packages:
    - covr

after_success:
    - Rscript -e 'library(covr); codecov()'

DESCRIPTION has the vignette line in it:

VignetteBuilder: knitr

knitr is also in my packrat.lock file and packrat is used for the build in .travis.yml.

I've tried the following to no avail:

  • added knitr to the r_packages in .travis.yml
  • added knitr to the Imports in DESCRIPTION
  • added r_check_args: "--no-vignettes" to travis.yml in the hopes of skipping the vignette building step.
  • added packrat call in travis.yml from install to before_install

I'm pretty knew to building R packages, never mind travis-ci so I'm not sure if I understand why the vignette builder would not have access to the knitr package.

Repo: https://github.com/cormac85/datakindr
Travis: https://travis-ci.org/cormac85/datakindr

2
So in the end I got the build to pass by just removing packrat config from the .travis.yml. This config was suggested in the Travis R Documentation but did not work for the loadVignetteBuilder() step during my builds. If anyone is still viewing this could you please comment on whether this looks like a problem specific to my build or if it's more general and worth raising an issue on the Travis-CI Github page?Cormac

2 Answers

3
votes

One potential problem involves the 'Imports' and/or 'Suggests' sections in your description file.

dplyr needs to be in your suggests, if not imports.

See Hadley's 2015 O'Reilly book, R Packages:

Common problems:

The vignette builds interactively, but when checking, it fails with an error about a missing package that you know is installed. This means that you’ve forgotten to declare that dependency in the DESCRIPTION (usually it should go in Suggests).

0
votes

So in the end I got the build to pass by just removing packrat config from .travis.yml and replacing it with the normal package building config: cache: packages.

The packrat config I used was suggested in the Travis R Documentation and worked well for the rest of the items in the package but it did not work for the loadVignetteBuilder() step during the build.