travis 构建失败,因为缺少 devtools [英] travis build failing because devtools is missing

查看:26
本文介绍了travis 构建失败,因为缺少 devtools的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置 travis 构建,但失败并显示以下错误:

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’

我的包不需要devtools来编译.

我已经在 DESCRIPTION 中将 devtools 添加到 Suggests:,将其添加到 .travis.yml(见下文)无济于事.

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")'

我做错了什么?

失败构建的日志文件:https://travis-ci.org/ThierryO/multimput/builds/97625211

包来源:https://github.com/ThierryO/multimput/tree/travis

推荐答案

根据 官方 Travis CI 文档.该解决方案有几个组成部分:

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:

  • 手动安装 devtools
  • 手动安装 CRAN 依赖项
  • 使用 math.ntnu.norstudio.com 存储库手动安装 INLA.第二个是必需的,因为第一个只有 INLA 包而不是依赖项.
  • 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.

构建日志

.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"))'

这篇关于travis 构建失败,因为缺少 devtools的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆