You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Posit Workbench(RStudio Pro)中R包curl安装失败求助

R包curl 6.1.0安装失败求助

近几个月来,我使用公司账号在Posit Workbench(RStudio Pro Ocean Storm 2024-01-28版本)的R 4.4.0新项目中,多次遇到R包curl(6.1.0)安装失败的问题。例如今日安装usethis或tidyverse时,curl安装环节均报错,控制台错误信息如下:

Installing curl [6.1.0] ...
    FAILED
Error installing package 'curl':
================================

* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS= 
Using PKG_LIBS=-lcurl  
Curl runtime version 7.29.0 
** libs
using C compiler: ‘gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)’
using C++ compiler: ‘g++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)’
using C++17
rm -f curl.so ada.o callbacks.o curl.o download.o escape.o fetch.o findport.o form.o getdate.o handle.o ieproxy.o init.o interrupt.o multi.o nslookup.o options.o reflist.o split.o ssl.o typechecking.o urlparser.o utils.o version.o winidn.o writer.o
g++  -std=c++17 -I"/opt/R/4.4.0/lib/R/include" -DNDEBUG -DUSE_ADA_PARSER -DSTRICT_R_HEADERS -DR_NO_REMAP  -I/usr/local/include    -fpic  -g -O2   -c ada.cpp -o ada.o
gcc -std=gnu11 -I"/opt/R/4.4.0/lib/R/include" -DNDEBUG -DUSE_ADA_PARSER -DSTRICT_R_HEADERS -DR_NO_REMAP  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c callbacks.c -o callbacks.o
gcc -std=gnu11 -I"/opt/R/4.4.0/lib/R/include" -DNDEBUG -DUSE_ADA_PARSER -DSTRICT_R_HEADERS -DR_NO_REMAP  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c curl.c -o curl.o
gcc -std=gnu11 -I"/opt/R/4.4.0/lib/R/include" -DNDEBUG -DUSE_ADA_PARSER -DSTRICT_R_HEADERS -DR_NO_REMAP  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c download.c -o download.o
gcc -std=gnu11 -I"/opt/R/4.4.0/lib/R/include" -DNDEBUG -DUSE_ADA_PARSER -DSTRICT_R_HEADERS -DR_NO_REMAP  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c escape.c -o escape.o
gcc -std=gnu11 -I"/opt/R/4.4.0/lib/R/include" -DNDEBUG -DUSE_ADA_PARSER -DSTRICT_R_HEADERS -DR_NO_REMAP  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c fetch.c -o fetch.o
gcc -std=gnu11 -I"/opt/R/4.4.0/lib/R/include" -DNDEBUG -DUSE_ADA_PARSER -DSTRICT_R_HEADERS -DR_NO_REMAP  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c findport.c -o findport.o
gcc -std=gnu11 -I"/opt/R/4.4.0/lib/R/include" -DNDEBUG -DUSE_ADA_PARSER -DSTRICT_R_HEADERS -DR_NO_REMAP  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c form.c -o form.o
gcc -std=gnu11 -I"/opt/R/4.4.0/lib/R/include" -DNDEBUG -DUSE_ADA_PARSER -DSTRICT_R_HEADERS -DR_NO_REMAP  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c getdate.c -o getdate.o
gcc -std=gnu11 -I"/opt/R/4.4.0/lib/R/include" -DNDEBUG -DUSE_ADA_PARSER -DSTRICT_R_HEADERS -DR_NO_REMAP  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c handle.c -o handle.o
In file included from handle.c:1:
handle.c: In function ‘set_handle_defaults’:
handle.c:211:35: error: ‘CURLOPT_PIPEWAIT’ undeclared (first use in this function); did you mean ‘CURLOPT_TIMEOUT’?
   assert(curl_easy_setopt(handle, CURLOPT_PIPEWAIT, 1L));
                                   ^~~~~~~~~~~~~~~~
curl-common.h:13:34: note: in definition of macro ‘assert’
 #define assert(x) assert_message(x, NULL)
                                  ^
handle.c:211:35: note: each undeclared identifier is reported only once for each function it appears in
   assert(curl_easy_setopt(handle, CURLOPT_PIPEWAIT, 1L));
                                   ^~~~~~~~~~~~~~~~
curl-common.h:13:34: note: in definition of macro ‘assert’
 #define assert(x) assert_message(x, NULL)
                                  ^
handle.c: In function ‘make_info_http_version’:
handle.c:427:36: error: ‘CURLINFO_HTTP_VERSION’ undeclared (first use in this function); did you mean ‘CURLOPT_HTTP_VERSION’?
   assert(curl_easy_getinfo(handle, CURLINFO_HTTP_VERSION, &res));
                                    ^~~~~~~~~~~~~~~~~~~~~
curl-common.h:13:34: note: in definition of macro ‘assert’
 #define assert(x) assert_message(x, NULL)
                                  ^
handle.c:432:8: error: ‘CURL_HTTP_VERSION_2_0’ undeclared (first use in this function); did you mean ‘CURL_HTTP_VERSION_1_0’?
   case CURL_HTTP_VERSION_2_0:
        ^~~~~~~~~~~~~~~~~~~~~
        CURL_HTTP_VERSION_1_0
handle.c: In function ‘make_handle_response’:
handle.c:497:51: error: ‘CURLINFO_SCHEME’ undeclared (first use in this function); did you mean ‘CURLINFO_FILETIME’?
   SET_VECTOR_ELT(res, 6, make_info_string(handle, CURLINFO_SCHEME));
                                                   ^~~~~~~~~~~~~~~
                                                   CURLINFO_FILETIME
make: *** [/opt/R/4.4.0/lib/R/etc/Makeconf:195: handle.o] Error 1
ERROR: compilation failed for package ‘curl’

我尝试过以下操作:

  • 在项目.Rprofile中添加options(renv.download.override = utils::download.file),但未解决问题

恳请提供解决方向或可行方案,谢谢!

内容的提问来源于stack exchange,提问作者Jane Lu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 00:34:52