从 R 配置 mongolite 包时出现 openssl 和 PKG_CONFIG_PATH 问题

从 R 配置 mongolite 包时出现 openssl 和 PKG_CONFIG_PATH 问题

在 RStudio 中尝试安装时,软件包“mongolite”无法自行安装。因此,我从https://cran.r-project.org/web/packages/mongolite/,将其解压到管理 R 包的文件夹中,/usr/local/lib/R/site-library然后启动,sudo ./configure但出现此错误

Found pkg-config cflags and libs!
Using PKG_CFLAGS=
Using PKG_LIBS=-lsasl2 -lssl -lcrypto -lresolv
./configure: line 71: /bin/R: No such file or directory
./configure: line 72: /bin/R: No such file or directory
./configure: line 73: /bin/R: No such file or directory
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because openssl/sasl was not found. Try installing:
 * deb: libssl-dev, libsasl2-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel, cyrus-sasl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev, sasl_dev (Solaris)
 * brew: openssl (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------

libssl-dev并且libsasl2-dev已安装并pkg-config位于我的 PATH 中,因此我找不到任何方法来解决该问题。我还尝试启动, ./configure PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig/"因为这是文件openssl.pc所在的位置,但仍然出现相同的错误。

答案1

我最终在 RStudio 中重新运行install.packages("mongolite"),它奇迹般地运行正常。

相关内容