Open gvegayon opened 9 years ago
Thanks for the report -- the overall experience when using packrat alongside R package development has not yet been fully fleshed out, but I believe in this case we need to either:
1) Ensure that the package ends up installed in the regular user library, or 2) Ensure that RStudio explicitly loads packrat from the local packrat library.
My guess is that RStudio is attempting to load the package before the library paths are actually properly restored, so I'll investigate further.
It looks like the issue was indeed in packrat -- the initialization script provides a sort-of back door to help RStudio handle packrat 'bootstrap' actions; this hook was being called too eagerly. The solution was to move that hook until after the regular initialization, so that hook only runs if regular packrat initialization failed.
Can you try the development version of packrat out and let me know if it resolves this issue for you?
After installing the dev version, this is what I got
> packrat::init()
Initializing packrat project in directory:
- "~/Documents/scj/productos/autoreport"
Adding these packages to packrat:
_
BH 1.58.0-1
DBI 0.3.1
R6 2.1.0
Rcpp 0.12.1
assertthat 0.1
bitops 1.0-6
brew 1.0-6
caTools 1.17.1
digest 0.6.8
dplyr 0.4.3
dygraphs 0.4.5
evaluate 0.7.2
formatR 1.2
highr 0.5
htmltools 0.2.6
htmlwidgets 0.5
jsonlite 0.9.17
knitr 1.11
lazyeval 0.1.10
lubridate 1.3.3
magrittr 1.5
markdown 0.7.7
memoise 0.2.1
mime 0.3
packrat 0.4.4-14
plyr 1.8.3
rmarkdown 0.8
roxygen2 4.1.1
stringi 0.5-5
stringr 1.0.0
xtable 1.7-4
xts 0.9-7
yaml 2.1.13
zoo 1.7-12
Fetching sources for BH (1.58.0-1) ... OK (CRAN current)
Fetching sources for DBI (0.3.1) ... OK (CRAN current)
Fetching sources for R6 (2.1.0) ... FAILED
Fetching sources for Rcpp (0.12.1) ... OK (CRAN current)
Fetching sources for assertthat (0.1) ... OK (CRAN current)
Fetching sources for bitops (1.0-6) ... OK (CRAN current)
Fetching sources for caTools (1.17.1) ... OK (CRAN current)
Fetching sources for digest (0.6.8) ... OK (CRAN current)
Fetching sources for dplyr (0.4.3) ... OK (CRAN current)
Fetching sources for dygraphs (0.4.5) ... OK (CRAN current)
Fetching sources for evaluate (0.7.2) ... OK (CRAN current)
Fetching sources for formatR (1.2) ... OK (CRAN current)
Fetching sources for highr (0.5) ... OK (CRAN current)
Fetching sources for htmltools (0.2.6) ... OK (CRAN current)
Fetching sources for htmlwidgets (0.5) ... OK (CRAN current)
Fetching sources for jsonlite (0.9.17) ... OK (CRAN current)
Fetching sources for knitr (1.11) ... OK (CRAN current)
Fetching sources for lazyeval (0.1.10) ... OK (CRAN current)
Fetching sources for lubridate (1.3.3) ... OK (CRAN current)
Fetching sources for magrittr (1.5) ... OK (CRAN current)
Fetching sources for markdown (0.7.7) ... OK (CRAN current)
Fetching sources for memoise (0.2.1) ... OK (CRAN current)
Fetching sources for mime (0.3) ... FAILED
Fetching sources for packrat (0.4.4-14) ... FAILED
Fetching sources for plyr (1.8.3) ... OK (CRAN current)
Fetching sources for rmarkdown (0.8) ... OK (CRAN current)
Fetching sources for stringi (0.5-5) ... OK (CRAN current)
Fetching sources for stringr (1.0.0) ... OK (CRAN current)
Fetching sources for xtable (1.7-4) ... OK (CRAN current)
Fetching sources for xts (0.9-7) ... OK (CRAN current)
Fetching sources for yaml (2.1.13) ... OK (CRAN current)
Fetching sources for zoo (1.7-12) ... OK (CRAN current)
Error in snapshotSources(project, activeRepos(project), allRecordsFlat) :
Errors occurred when fetching source files:
Error in getSourceForPkgRecord(pkgRecord, sourceDir, availablePkgs, repos) :
Couldn't find source for version 2.1.0 of R6 (2.1.1 is current)
Error in getSourceForPkgRecord(pkgRecord, sourceDir, availablePkgs, repos) :
Couldn't find source for version 0.3 of mime (0.4 is current)
Error in getSourceForPkgRecord(pkgRecord, sourceDir, availablePkgs, repos) :
Failed to download package from URL:
- 'http://github.com/rstudio/packrat/archive/d741efa6d0a6355d2f4c26d6c9bf104c80186305.tar.gz'
Strange -- the URL http://github.com/rstudio/packrat/archive/d741efa6d0a6355d2f4c26d6c9bf104c80186305.tar.gz does seem to exist; I'm also curious what happened for R6
and mime
(both of those should be discovered in the CRAN repository archives, e.g. at https://cran.r-project.org/src/contrib/Archive/R6/R6_2.1.0.tar.gz)
On the off chance that this was a brief 'network outage' error ... can you try once more?
@gvegayon Did you find a solution?
Hey, sorry for the delay. Here is what I get now
> packrat::init()
Initializing packrat project in directory:
- "~/Dropbox/scj/productos/autoreport"
Adding these packages to packrat:
_
BH 1.60.0-1
DBI 0.3.1
R6 2.1.2
RJSONIO 1.3-0
Rcpp 0.12.4
assertthat 0.1
bitops 1.0-6
caTools 1.17.1
digest 0.6.9
dplyr 0.4.3
evaluate 0.8.3
formatR 1.3
googleVis 0.5.10
highr 0.5.1
htmltools 0.3.5
knitr 1.12.3
lazyeval 0.1.10
lubridate 1.5.6
magrittr 1.5
markdown 0.7.7
mime 0.4
packrat 0.4.7-8
pander 0.6.0
rmarkdown 0.9.5
stringi 1.0-1
stringr 1.0.0
xtable 1.8-2
yaml 2.1.13
Fetching sources for BH (1.60.0-1) ... OK (CRAN archived)
Fetching sources for DBI (0.3.1) ... OK (CRAN archived)
Fetching sources for R6 (2.1.2) ... OK (CRAN current)
Fetching sources for RJSONIO (1.3-0) ... OK (CRAN current)
Fetching sources for Rcpp (0.12.4) ... OK (CRAN current)
Fetching sources for assertthat (0.1) ... OK (CRAN current)
Fetching sources for bitops (1.0-6) ... OK (CRAN current)
Fetching sources for caTools (1.17.1) ... OK (CRAN current)
Fetching sources for digest (0.6.9) ... OK (CRAN current)
Fetching sources for dplyr (0.4.3) ... OK (CRAN current)
Fetching sources for evaluate (0.8.3) ... OK (CRAN archived)
Fetching sources for formatR (1.3) ... OK (CRAN current)
Fetching sources for googleVis (0.5.10) ... OK (CRAN current)
Fetching sources for highr (0.5.1) ... OK (CRAN current)
Fetching sources for htmltools (0.3.5) ... OK (CRAN current)
Fetching sources for knitr (1.12.3) ... OK (CRAN current)
Fetching sources for lazyeval (0.1.10) ... OK (CRAN current)
Fetching sources for lubridate (1.5.6) ... OK (CRAN current)
Fetching sources for magrittr (1.5) ... OK (CRAN current)
Fetching sources for markdown (0.7.7) ... OK (CRAN current)
Fetching sources for mime (0.4) ... OK (CRAN current)
Fetching sources for packrat (0.4.7-8) ... FAILED
Fetching sources for pander (0.6.0) ... OK (CRAN current)
Fetching sources for rmarkdown (0.9.5) ... OK (CRAN archived)
Fetching sources for stringi (1.0-1) ... OK (CRAN current)
Fetching sources for stringr (1.0.0) ... OK (CRAN current)
Fetching sources for xtable (1.8-2) ... OK (CRAN current)
Fetching sources for yaml (2.1.13) ... OK (CRAN current)
Error in snapshotSources(project, activeRepos(project), allRecordsFlat) :
Errors occurred when fetching source files:
Error in getSourceForPkgRecord(pkgRecord, sourceDir, availablePkgs, repos) :
Failed to download package from URL:
- 'https://api.github.com/rstudio/packrat/archive/2e56f3c0869d744c523056d5aa984722c1440632.tar.gz'
> devtools::session_info()
Session info -------------------------------------------------------------------------------------------------------------------------------
setting value
version R version 3.3.0 (2016-05-03)
system x86_64, linux-gnu
ui RStudio (0.99.893)
language en_US
collate en_US.UTF-8
tz <NA>
date 2016-05-08
Packages -----------------------------------------------------------------------------------------------------------------------------------
package * version date source
curl 0.9.7 2016-04-10 CRAN (R 3.2.4)
devtools 1.11.1 2016-04-21 CRAN (R 3.2.5)
digest 0.6.9 2016-01-08 CRAN (R 3.2.3)
git2r 0.14.0 2016-03-13 CRAN (R 3.2.4)
httr 1.1.0 2016-01-28 CRAN (R 3.2.3)
memoise 1.0.0 2016-01-29 CRAN (R 3.2.3)
packrat 0.4.7-8 2016-05-08 Github (rstudio/packrat@2e56f3c)
R6 2.1.2 2016-01-26 CRAN (R 3.2.3)
withr 1.0.1 2016-02-04 CRAN (R 3.2.3)
Ah, it looks like the GitHub API links don't work for archive downloads :/ I'll need to revert https://github.com/rstudio/packrat/commit/5b2d2072dc3889c6185af243b2967d5e4fba167f and revisit later.
After initializing packrat, when I try to build the R package that I'm developing, Rstudio fails to load the package. This has a clear explanation, while the package is installed in the packrat directory, the packrat directory is not among the locations where
library
looks at.In other words, after pressing Ctrl + Alt + b, I see the following messages
Build window:
Console: