Travis-CI build with R package: Error in running tools::texi2pdf()

testthat

#1

I’m creating an R package and running into this build failure in Travis-CI.

When I run the check manually via $ R CMD check package.tar.gz, there are no ERRORS:

...
* checking tests ...
  Running ‘testthat.R’
 OK
* checking PDF version of manual ... OK
* DONE

Status: 6 WARNINGs, 3 NOTEs
See

However, here is the error causing the Travis-CI build to fail:

* checking tests ...
  Running ‘testthat.R’
 OK
* checking PDF version of manual ... WARNING
LaTeX errors when creating PDF version.
This typically indicates Rd problems.
* checking PDF version of manual without hyperrefs or index ... ERROR
Re-running with no redirection of stdout/stderr.
Hmm ... looks like a package
Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  : 
  pdflatex is not available
Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  : 
  pdflatex is not available
Error in running tools::texi2pdf()
You may want to clean up by 'rm -rf /tmp/RtmpR5975i/Rd2pdf413d6976434f'
* DONE
Status: 1 ERROR, 5 WARNINGs, 2 NOTEs
See
  ‘/home/travis/build/package/package.Rcheck/00check.log’
for details.
The command "R CMD check *tar.gz" exited with 1.

I’m not sure why the test would fail in Travis-CI but not manually. I’m also not sure how to best solve this issue.


#2

I’m having the same problem, and also have no idea how to fix it. So while I can’t help, I feel your pain. :slight_smile:


#3

Here is the solution I found:

The previous .travis.yml config file was here: github/craigcitro/r-travis/wiki

which uses

language: c

There is now built-in support for R, cf at travis docs/user/languages/r/

I added this to the config file:

language: r

before_install:
  - tlmgr install index

Then, the Travis-CI build will pass.