Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

travis build failing because devtools is missing

I'm trying to setup a travis build but it fails with the error below:

$ export PKG_TARBALL=$(Rscript -e 'pkg <- devtools::as.package("."); cat(paste0(pkg$package, "_", pkg$version, ".tar.gz"));')
Error in loadNamespace(name) : there is no package called ‘devtools’

My package doesn't need devtools to compile.

I've added devtools to Suggests: in the DESCRIPTION, added it to .travis.yml (see below) be no avail.

language: r
sudo: required
# System dependencies for HTTP calling
apt_packages:
 - libcurl4-openssl-dev
 - libxml2-dev
r_binary_packages:
  - devtools
install:
  - Rscript -e 'install.packages("INLA", repos="http://www.math.ntnu.no/inla/R/stable")'

What am I doing wrong?

Log file of the failing build: https://travis-ci.org/ThierryO/multimput/builds/97625211

Source of the package: https://github.com/ThierryO/multimput/tree/travis

like image 463
Thierry Avatar asked Dec 18 '15 10:12

Thierry


1 Answers

I'm managed to get it up and running with the .travis.yml according to the official Travis CI documentation. The solution has several components:

  • install devtools manually
  • install CRAN dependencies manually
  • install INLA manually with both the math.ntnu.no and rstudio.com repositories. The second is required because the first has only the INLA packages and not it's dependencies.

Build log

.travis.yml

language: r
sudo: required
install:
  - Rscript -e 'install.packages("devtools", repos = "http://cran.rstudio.com")'
  - Rscript -e 'install.packages(c("plyr", "geepack", "snowfall"), repos = "http://cran.rstudio.com")'
  - Rscript -e 'install.packages("INLA", repos = c("http://www.math.ntnu.no/inla/R/stable", "http://cran.rstudio.com"))'
like image 97
Thierry Avatar answered Nov 15 '22 17:11

Thierry