craigcitro / r-travis

Tools for using R with Travis (http://travis-ci.org) in lieu of a website:

Home Page:https://github.com/craigcitro/r-travis/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Error in loadNamespace(name) : there is no package called ‘devtools’"

maelle opened this issue · comments

I'm getting this error for the builds of packages, e.g. https://travis-ci.org/masalmon/ammon/builds/106474060 and https://travis-ci.org/masalmon/Ropenaq/builds/110089596

I first got the error for a package I was currently modifying so I thought I had done something wrong, but then I tried to re-build a commit of another package that was ok yesterday and I got the same error. Could it be due to something on my PC or is it a Travis issue? I'm quite puzzled.

I'm having this problem again, e.g.
https://travis-ci.org/TGuillerme/Inapp/builds/343416007 (where I managed to work around the issue),
https://travis-ci.org/ms609/TreeSearch/builds/349720182 (where I did not)

Related: travis-ci/travis-ci#5650

In general I would recommend not using r_packages and instead relying on the package cache. Also would just rely on the travis script to install devtools from CRAN (i.e. remove it from r_packages) unless you explicitly need a feature from devel version of devtools.

Thanks for the suggestion, though I'm not sure I've quite followed it correctly: removing the r_packages block entirely means that the package testthat can't be found (though devtools can):

Error in library("testthat") : there is no package called ‘testthat’
--- https://travis-ci.org/ms609/TreeSearch/builds/351351965

Removing only devtools from the r_packages block does indeed provide a fix for release and oldrel, but not for devel, where I receive

Error: package or namespace load failed for ‘devtools’:
package ‘devtools’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
--- https://travis-ci.org/ms609/TreeSearch/jobs/351354534

... which I suppose means that your suggestion worked and I've now 'levelled up' to a different error?

Setting sudo: false and deleting your package cache should fix both issues I think.

I've cleared the package cache in travis, and set sudo:false (in .travis.yml) but still encounter the error: [https://travis-ci.org/ms609/TreeSearch/builds/352440468]

I've also tried removing the cache: packages line (.travis.yml), to no avail:

Error in library("devtools") : there is no package called ‘devtools’
--- [https://travis-ci.org/ms609/TreeSearch/builds/352937999