首页 > 解决方案 > R 安装和重启失败

问题描述

一段时间以来,我一直在为工作而开发 R 包,并且已经进行了一年多的更新并将其安装到我的机器上。出于某种原因,上个月,我无法再构建源代码、二进制文件,因此无法安装和重新启动。

当我选择文档选项时:

==> devtools::document(roclets = c('rd', 'collate', 'namespace'))

i Updating LICHospitalR documentation
i Loading LICHospitalR
Writing NAMESPACE
Writing NAMESPACE
Documentation completed

它运行成功。

现在当我点击Install and Restart

==> Rcmd.exe INSTALL --no-multiarch --with-keep.source LICHospitalR

* installing to library 'C:/Users/bha485/Documents/R/win-library/4.1'
* installing *binary* package 'LICHospitalR' ...
cp: unknown option -- )
Try '/usr/bin/cp --help' for more information.
ERROR: installing binary package failed
* removing 'C:/Users/bha485/Documents/R/win-library/4.1/LICHospitalR'
* restoring previous 'C:/Users/bha485/Documents/R/win-library/4.1/LICHospitalR'

Exited with status 1.

另外,当我进行检查时:

==> devtools::check()

i Updating LICHospitalR documentation
i Loading LICHospitalR
Registered S3 method overwritten by 'tune':
  method                   from   
  required_pkgs.model_spec parsnip
Registered S3 methods overwritten by 'stars':
  method             from
  st_bbox.SpatRaster sf  
  st_crs.SpatRaster  sf  
Writing NAMESPACE
Writing NAMESPACE
-- Building ------------------------------------- LICHospitalR --
Setting env vars:
* CFLAGS    : -Wall -pedantic -fdiagnostics-color=always
* CXXFLAGS  : -Wall -pedantic -fdiagnostics-color=always
* CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always
-----------------------------------------------------------------
v  checking for file 'C:\Users\bha485\Desktop\LICHospitalR/DESCRIPTION' ...
-  preparing 'LICHospitalR': (3.3s)
v  checking DESCRIPTION meta-information ... 
v  checking whether 'INDEX' is up-to-date (929ms)
-  installing the package to build vignettes
         -----------------------------------
-  installing *binary* package 'LICHospitalR' ...
   cp: unknown option -- )
   Try '/usr/bin/cp --help' for more information.
   ERROR: installing binary package failed
-  removing 'C:/Users/bha485/AppData/Local/Temp/RtmpQX3Cq3/Rinst1e246e7f3ee6/LICHospitalR'
         -----------------------------------
   ERROR: package installation failed

Error: System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
E> * checking for file 'C:\Users\bha485\Desktop\LICHospitalR/DESCRIPTION' ... OK
E> * preparing 'LICHospitalR':
E> * checking DESCRIPTION meta-information ... OK
E> * checking whether 'INDEX' is up-to-date ... OK
E> * installing the package to build vignettes
E>       -----------------------------------
E> * installing *binary* package 'LICHospitalR' ...
E> cp: unknown option -- )
E> Try '/usr/bin/cp --help' for more information.
E> ERROR: installing binary package failed
E> * removing 'C:/Users/bha485/AppData/Local/Temp/RtmpQX3Cq3/Rinst1e246e7f3ee6/LICHospitalR'
E>       -----------------------------------
E> ERROR: package installation failed

 Stack trace:

 1. devtools::check(, check_dir = dirname(getwd()))
 2. withr::with_envvar(pkgbuild::compiler_flags(FALSE), action = "pre ...
 3. base:::force(code)
 4. pkgbuild::build(pkg$path, tempdir(), args = build_args, quiet = q ...
 5. withr::with_temp_libpaths(rcmd_build_tools(options$cmd, c(options ...
 6. base:::force(code)
 7. pkgbuild:::rcmd_build_tools(options$cmd, c(options$path, options$ ...
 8. pkgbuild:::with_build_tools(callr::rcmd_safe(..., env = env,  ...
 9. withr::with_path(rtools_path(), code)
 10. base:::force(code)
 11. callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE,  ...
 12. callr:::run_r(options)
 13. base:::with(options, with_envvar(env, do.call(processx::run,  ...
 14. base:::with.default(options, with_envvar(env, do.call(processx::r ...
 15. base:::eval(substitute(expr), data, enclos = parent.frame())
 16. base:::eval(substitute(expr), data, enclos = parent.frame())
 17. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args  ...
 18. base:::force(code)
 19. base:::do.call(processx::run, c(list(bin, args = real_cmdargs,  ...
 20. (function (command = NULL, args = character(), error_on_status = TRUE,  ...
 21. throw(new_process_error(res, call = sys.call(), echo = echo,  ...

 x System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
E> * checking for file 'C:\Users\bha485\Desktop\LICHospitalR/DESCRIPTION' ... OK
E> * preparing 'LICHospitalR':
E> * checking DESCRIPTION meta-information ... OK
E> * checking whether 'INDEX' is up-to-date ... OK
E> * installing the package to build vignettes
E>       -----------------------------------
E> * installing *binary* package 'LICHospitalR' ...
E> cp: unknown option -- )
E> Try '/usr/bin/cp --help' for more information.
E> ERROR: installing binary package failed
E> * removing 'C:/Users/bha485/AppData/Local/Temp/RtmpQX3Cq3/Rinst1e246e7f3ee6/LICHospitalR'
E>       -----------------------------------
E> ERROR: package installation failed 

Execution halted

Exited with status 1.

会话信息:

> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.1.0 tools_4.1.0   
> 

我真的不知道从哪里开始,我应该把它作为一个问题提交到 github rstudio/rstudio 上吗?或者我可以采取其他途径。

更新

项目的 GitHub

标签: rwindows

解决方案


推荐阅读