即使表达式失败,“ R -e <expr>”也会抛出退出代码0(RODBC安装)

时间:2019-10-03 10:10:50

标签: r rodbc

在尝试运行命令时

R -e 'devtools::install_version(c("RODBC"), quiet = FALSE, repos = c("https://cran.r-project.org"), dependencies = TRUE)'

在终端上,我在安装过程中出错,该命令返回的退出代码为0。 下面是日志。

R version 3.5.1 (2018-07-02) – "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

devtools::install_version(c("RODBC"), quiet = FALSE, repos = c("https://cran.r-project.org"), dependencies = TRUE)
trying URL 'https://cran.r-project.org/src/contrib/RODBC_1.3-16.tar.gz'
Content type 'application/x-gzip' length 1172291 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

installing source package ‘RODBC’ ...
** package ‘RODBC’ successfully unpacked and MD5 sums checked
checking for gcc... x86_64-conda_cos6-linux-gnu-cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-conda_cos6-linux-gnu-cc accepts -g... yes
checking for x86_64-conda_cos6-linux-gnu-cc option to accept ISO C89... none needed
checking how to run the C preprocessor... /usr/lib/environs/e-a-2019.03-r-3.5.1/bin/x86_64-conda_cos6-linux-gnu-cpp
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sql.h usability... yes
checking sql.h presence... yes
checking for sql.h... yes
checking sqlext.h usability... yes
checking sqlext.h presence... yes
checking for sqlext.h... yes
checking for library containing SQLTables... no
configure: error: "no ODBC driver manager found"
ERROR: configuration failed for package ‘RODBC’
removing ‘/usr/lib/environs/e-a-2019.03-r-3.5.1/lib/R/library/RODBC’
The downloaded source packages are in
‘/tmp/RtmpWrVyjl/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages(package, repos = repos, contriburl = contriburl, :
installation of package ‘RODBC’ had non-zero exit status

我不确定此错误是与rodbc或R有关还是与R处理错误有关。如果发生其他类似PackageNotFound的错误,则退出代码为1。我正在通过脚本运行上述命令,并在命令完成后检查退出代码。在这里应该执行什么检查出口代码?

0 个答案:

没有答案