Appveyor 问题 - 无法安装 R 包 stringi

Appveyor problem - R package stringi can't be installed

最近使用 Appveyor 的构建不再有效。它在实际构建程序之前失败了,因为不知何故无法安装包 stringi

本地一切正常,但我需要 Appveyor 的解决方法。 有人有解决此问题的解决方案吗?

这是 Appveyor 上的错误消息:

  • installing source package 'stringi' ... ** package 'stringi' successfully unpacked and MD5 sums checked ** libs * arch - i386 c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"c:/R/include" -DNDEBUG -I. -Iicu61/ -Iicu61/unicode -Iicu61/common -Iicu61/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DU_TOOLUTIL_IMPLEMENTATION -DNDEBUG -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DU_USE_STRTOD_L=0 -O2 -Wall -mtune=generic -c stri_ICU_settings.cpp -o stri_ICU_settings.o /bin/sh: c:/Rtools/mingw_32/bin/g++: No such file or directory make: * [stri_ICU_settings.o] Error 127 ERROR: compilation failed for package 'stringi'
  • removing 'c:/RLibrary/stringi' In R CMD INSTALL Error in i.p(...) : (converted from warning) installation of package 'stringi' had non-zero exit status Calls: ... with_rprofile_user -> with_envvar -> force -> force -> i.p Execution halted Command exited with code 1

另请参阅: https://ci.appveyor.com/project/frehbach/eventdetectr/builds/19569698

您可以通过添加

来解决这个问题
USE_RTOOLS: true

给你的 appveyor.yml (see here).

问题是因为你没有任何需要编译的代码,所以AppVeyor没有安装Rtools,但是编译stringi显然需要Rtools;请参阅 build log you linked to:

的第 40 行
== 10/17/2018 06:33:11: Skipping download of Rtools because src/ directory is missing.

使用上面提到的 AppVeyor 设置将强制安装 Rtools。