R 安装devtools包失败

R 安装devtools包失败,r,devtools,R,Devtools,我正在尝试安装名为devtools的包。我运行命令: install.packages(“devtools”)或install.packages(“devtools”,dependencies=TRUE)我得到了相同的错误: Error: package or namespace load failed for ‘gert’: .onLoad failed in loadNamespace() for 'gert', details: call: NULL error: 'as_tex

我正在尝试安装名为devtools的包。我运行命令:
install.packages(“devtools”)
install.packages(“devtools”,dependencies=TRUE)
我得到了相同的错误:

Error: package or namespace load failed for ‘gert’:
 .onLoad failed in loadNamespace() for 'gert', details:
  call: NULL
  error: 'as_text' is not an exported object from 'namespace:sys'
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/ab/usr/my_user/R/x86_64-pc-linux-gnu-library/3.5/gert’
Warning in install.packages :
  installation of package ‘gert’ had non-zero exit status
ERROR: dependency ‘gert’ is not available for package ‘usethis’
* removing ‘/ab/usr/my_user/R/x86_64-pc-linux-gnu-library/3.5/usethis’
Warning in install.packages :
  installation of package ‘usethis’ had non-zero exit status
ERROR: dependency ‘usethis’ is not available for package ‘devtools’
* removing ‘/ab/usr/my_user/R/x86_64-pc-linux-gnu-library/3.5/devtools’
Warning in install.packages :
  installation of package ‘devtools’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmpj3P5T5/downloaded_packages’
我已尝试运行
install.packages(“gert”)
,但出现错误:

Error: package or namespace load failed for ‘gert’:
 .onLoad failed in loadNamespace() for 'gert', details:
  call: NULL
  error: 'as_text' is not an exported object from 'namespace:sys'
Error: loading failed
Execution halted
有人有什么想法吗

以下是一些systemInfo():

R版本3.5.2(2018-12-20) 平台:x86_64-pc-linux-gnu(64位)


我已经看过了类似的问题,在这些问题中,评论者/回答者建议关闭和打开Rstudio或重新启动R会话。我已经试过了,但返回了相同的错误。

将R更新到最新版本成功。

您的R版本非常旧。你能更新吗?不幸的是,没有。我会调查的,但我不是很有希望。好的。devtools拉入一组包,这些包反过来也会拉入。其中一个可能与较旧的r版本不兼容。还有一些软件包有系统要求。您也可以尝试重新安装
sys
。坦率地说,我认为关于sys::as_text的错误是一个令人费解的问题,因为它是在大约2年前添加到该软件包中的,但可能是安装被破坏了。使用最新版本的R下载了自定义R安装。works now