rstudio / packrat

Packrat is a dependency management system for R
http://rstudio.github.io/packrat/
401 stars 89 forks source link

packrat.lock file not getting detected #632

Closed kumarutkarshbst closed 3 years ago

kumarutkarshbst commented 3 years ago

Hello, I 'm trying to restore a packrat bundle in docker, but somehow it is not able to detect the lock file in it. The error message is "Error: This project does not have a lockfile. (Have you called 'packrat::snapshot()' yet?) Execution halted The command '/bin/sh -c su docker -c "R -e 'packrat::restore();'"' returned a non-zero code: 1".

I've checked, lock file is there and I'm able to restore it in my setup but not on the docker. what might be the reason for that? and what should I look into for solving such error? pls let me know if I need to provide some extra info as well.

The code I have used is: 1) packrat::init(options = list(external.packages = c("shiny", "shinyjs", "writexl", "stringr", "shinyTime", "lubridate", "chron", "openxlsx", "shinydashboard", "DT")))
2) packrat::snapshot() 3) packrat::bundle(include.bundles = FALSE, omit.cran.src = TRUE)

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

Matrix products: default

locale: [1] LC_COLLATE=English_India.1252 LC_CTYPE=English_India.1252 LC_MONETARY=English_India.1252 [4] LC_NUMERIC=C LC_TIME=English_India.1252

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

other attached packages: [1] DT_0.18 shinydashboard_0.7.1 openxlsx_4.2.3 chron_2.3-56
[5] lubridate_1.7.10 shinyTime_1.0.1 stringr_1.4.0 writexl_1.4.0
[9] shinyjs_2.0.0 shiny_1.6.0

loaded via a namespace (and not attached): [1] Rcpp_1.0.6 magrittr_2.0.1 xtable_1.8-4 R6_2.5.0 rlang_0.4.11
[6] fastmap_1.1.0 tools_4.1.0 packrat_0.6.0 htmltools_0.5.1.1 ellipsis_0.3.2
[11] digest_0.6.27 lifecycle_1.0.0 zip_2.2.0 later_1.2.0 htmlwidgets_1.5.3 [16] promises_1.2.0.1 mime_0.10 stringi_1.6.1 compiler_4.1.0 generics_0.1.0
[21] httpuv_1.6.1

kevinushey commented 3 years ago

What is the working directory of the R process in your Docker container? Is it the same as the project directory (containing the lockfile)?