render_book error "stop_if_not_exists" and "some files were not found" (revisited)

In this post I need to revisit the post render_book error "stop_if_not_exists" and "some files were not found" - #30 by cderv as the same error is happening again. It was never clear in the OP why the error went away and therefore it is not clear why the error is occurring again.

To revisit:

  1. I use the render_book in a .r file to compile my .Rmd file to a .html (or other formats)

For example a file Testing123.Rmd file in a folder called source-posts, upon running the script below, will write to a file Test123.html in a folder output/source-posts

file_to_render <- "Testing123"
library(bookdown)
render_book(
input = "./source-posts",
output_format = c("bookdown::html_book"),
output_dir = "../output/posts",
output_file = paste0(file_to_render),
envir = parent.frame(),
output_yaml= "_output.yml",
config_file= "_bookdown.yml",
quiet = FALSE,
encoding = "UTF-8"
)
`

  1. This method has worked in the past and worked again, for some reason, at the end of the OP which is why I expect the ticket was closed.

  2. The result of the script now is the error message

render_book(

  • input = "./source-posts",
  • output_format = c("bookdown::html_book"),
  • output_dir = "../output/posts",
  • output_file = paste .... [TRUNCATED]
    Error in stop_if_not_exists(input) :
    Some files were not found: ./source-posts

which is the same error message as in the OP.

  1. Thinking that perhaps this error had been fixed with a new version of bookdown I installed bookdown ver 0.28 as seen from

sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: aarch64-apple-darwin21.3.0 (64-bit)
Running under: macOS Monterey 12.4
Matrix products: default
LAPACK: /opt/homebrew/Cellar/r/4.2.0/lib/R/lib/libRlapack.dylib
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bookdown_0.28
loaded via a namespace (and not attached):
[1] compiler_4.2.0 fastmap_1.1.0 htmltools_0.5.2 tools_4.2.0 yaml_2.3.5 rmarkdown_2.14 knitr_1.39 xfun_0.31
[9] digest_0.6.29 rlang_1.0.2 evaluate_0.15

  1. In the OP there is a link to a Bitbucket Repo with a minimal working example which @cderv has said in the past compiles without error. I have added to this minimal working example the file Testing123.Rmd and run the renderscript_singlePost.r in this repo (as on my own machine) and in both cases gotten the error

Error in stop_if_not_exists(input) :

Advice or a solution would be much appreciated as I cannot continue work without a solution.

Best, Jason

Update from my end:

After trying to revert to the previous version of bookdown 0.26 which the render_book script mentioned above worked, I got the same error

Error in render_book(input = "./source-posts", output_format = c("bookdown::html_book"), :
Some files were not found: ./source-posts

From the OP (which is closed) and hence I have had to "revisit" it by making this new post, I believe @cderv mentioned that something might have changed in the "xfun" package. I realized in this new post that while I updated bookdown to 0.28 I did not also update the other packages.

I have resolved this by

require(devtools)
install_version(“bookdown”, version = “0.28”, repos = "http://cran.us.r-project.org")

which gave the option to update other related packages I presume (e.g. xfun to 0.32)

My current setup is

sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: aarch64-apple-darwin21.3.0 (64-bit)
Running under: macOS Monterey 12.4
Matrix products: default
LAPACK: /opt/homebrew/Cellar/r/4.2.0/lib/R/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] devtools_2.4.4 usethis_2.1.6 bookdown_0.28
loaded via a namespace (and not attached):
[1] Rcpp_1.0.9 urlchecker_1.0.1 compiler_4.2.0 later_1.3.0 remotes_2.4.2 prettyunits_1.1.1 profvis_0.3.7 tools_4.2.0 digest_0.6.29
[10] pkgbuild_1.3.1 pkgload_1.3.0 evaluate_0.16 memoise_2.0.1 lifecycle_1.0.1 rlang_1.0.4 shiny_1.7.2 cli_3.3.0 rstudioapi_0.13
[19] yaml_2.3.5 xfun_0.32 fastmap_1.1.0 stringr_1.4.0 knitr_1.39 fs_1.5.2 htmlwidgets_1.5.4 glue_1.6.2 R6_2.5.1
[28] processx_3.7.0 rmarkdown_2.14 sessioninfo_1.2.2 purrr_0.3.4 callr_3.7.1 magrittr_2.0.3 promises_1.2.0.1 ps_1.7.1 ellipsis_0.3.2
[37] htmltools_0.5.3 mime_0.12 xtable_1.8-4 httpuv_1.6.5 stringi_1.7.8 miniUI_0.1.1.1 cachem_1.0.6 crayon_1.5.1

When running the render_book script now I still receive the "some files not found" error

render_book(

  • input = "./source-posts",
  • output_format = c("bookdown::html_book"),
  • output_dir = "../output/posts",
  • output_file = paste .... [TRUNCATED]
    Error in render_book(input = "./source-posts", output_format = c("bookdown::html_book"), :
    Some files were not found: ./source-posts

I am now officially out of ideas and hoping that some advice on how to proceed or some insight to what I am doing wrong would be much appreciated.

Best,

Jason

Since there is not any traction on this post and I need to keep writing and working, I will close with the work around I have come to in case it helps anyone and documents (at least for myself) the settings for which my workflow last worked.

I have an "older" build of Rstudio and bookdown (and what I assume to be required packages, xfun, etc.) on another machine for which the scripts in the Bitbucket Repo compile correctly a foo.Rmd into foo.html (via a combination of the script and setting in _output.yml using render_book bookdown::html_book) or other output formats like bookdown::gitbook, bookdown::epub_book, bookdown::pdf_book.

The session information for this working build is:

sessionInfo()
R version 4.1.3 (2022-03-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.1.3 fastmap_1.1.0 htmltools_0.5.2 tools_4.1.3 yaml_2.3.5 rmarkdown_2.13
[7] knitr_1.38 xfun_0.30 digest_0.6.29 rlang_1.0.2 evaluate_0.15

I did try to revert to old versions on my new machine, to replicate the old machine build, but I must have missed some reversions and was not able to replicate the old build.

Thanks to all at @RStudio for your efforts.

Best,

Jason

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.