R Travis CI错误:建议使用包装,但不可用:“ ridge”

时间:2018-10-04 15:42:14

标签: r travis-ci r-package

我正在尝试为我的R软件包之一运行Travis CI。问题是构建失败并出现错误,指出该软件包的一个依赖项不可用(名为“ ridge”的软件包)

以下是错误日志:

* checking extension type ... Package
* this is package ‘imputeR’ version ‘2.1’
* checking package namespace information ... OK
* checking package dependencies ... ERROR
Package suggested but not available: ‘ridge’
The suggested packages are required for a complete check.
Checking can be attempted without them by setting the environment
variable _R_CHECK_FORCE_SUGGESTS_ to a false value.
See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’
manual.
* DONE
Status: 1 ERROR
See
 ‘/home/travis/build/SteffenMoritz/imputeR/imputeR.Rcheck/00check.log’
for details.
0.38schecking package dependencies ... ERROR
Package suggested but not available: ‘ridge’

这也是Travis构建的链接:  https://travis-ci.org/SteffenMoritz/imputeR/builds/436334069

Travis无法使用的软件包是当前在CRAN上的普通软件包。这可能与ridge ..需要Gnu科学图书馆版本> = 1.14有关吗?我能以某种方式解决这个问题吗?

2 个答案:

答案 0 :(得分:1)

您说对了,这是正确的,这是因为ridge需要一个外部库(Gnu Scientific库),该库默认未安装在travis上。

Travis CI docs详细说明如何安装外部软件包。

根据您的情况,您需要添加

addons:
  apt:
    packages: libgsl0-dev

到您的.travis.yml

答案 1 :(得分:0)

找到了至少让TRAVIS完成检查的解决方案

您可以将其添加到Travis配置yaml文件中:

void Main()
{
    var data1 = new List<DataElement>{
        new DataElement{Mass = 145.56, Intensity = 14},
        new DataElement{Mass = 246.44, Intensity = 30},
        new DataElement{Mass = 346.55, Intensity = 58},
        new DataElement{Mass = 204.78, Intensity = 49},
    };
    var data2 = new List<DataElement>{
        new DataElement{Mass = 151.62, Intensity = 67},
        new DataElement{Mass = 223.18, Intensity = 56},
        new DataElement{Mass = 389.78, Intensity = 23},
        new DataElement{Mass = 266.96, Intensity = 47},
    };  

    var result = Summarize(data1.Concat(data2), 50);
}

据我了解,缺点是:包括建议软件包在内的所有内容都不会被检查。因此解决方案并不完全令人满意。