4

After I updated R to 3.5, I found I couldn't render .Rmd file. I tried to reinstall the relevant packages, but it seemed it didn't solve the problem. More specifically, the error message is:

blogdown:::serve_site()

Rendering content/post/mypost.Rmd

Fatal error: cannot open file 'C:/Users/John': No such file or directory

Error in render_page(f) : Failed to render 'content/post/mypost.Rmd'

My blogdown.Rproj is under the folder C:\Users\John Smith\Documents\GitHub\blogdown. I am not sure why the path in the error message only shows cannot open file 'C:/Users/John', the remaining part of the path was missing. Note the space in "John Smith"

Your help will be really appreciated!

Xing Zhang
  • 175
  • 1
  • 5

1 Answers1

4

You ran into the same problem as Is this a bug in R 3.5?, and I just applied a workaround in the devel version of blogdown:

devtools::install_github('rstudio/blogdown')
Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
  • Thanks for solving the problem and the pointer to a broader issue. Now the file got rendered successfully, and the resulted .html is fine, too. A minor issue is the viewer is empty. Did I miss anything? – Xing Zhang Apr 29 '18 at 05:53
  • How about refreshing the viewer? (Hit the refresh button on the top right) – Yihui Xie Apr 29 '18 at 14:20
  • Thanks for the reply. The refresh button seems not working. Actually all the buttons are disabled under the viewer tab. – Xing Zhang Apr 30 '18 at 02:23
  • Can you restart R, `update.packages(ask = F); devtools::install_github('yihui/servr')`, and retry `blogdown::serve_site()`? – Yihui Xie Apr 30 '18 at 15:02
  • Nope, the viewer is still empty... Another difference I noticed is that when I saved the edits, the .Rmd was no longer automatically rendered. Previously if I ran `blogdown::serve_site()`, subsequently the file would be automatically rendered when I save the file. In any case, thank you for the help. – Xing Zhang May 01 '18 at 09:33
  • Weird. If you are using the latest version of RStudio and the problem persists, I can chat with you directly with screensharing to investigate the issue if that is a possible option for you. – Yihui Xie May 01 '18 at 14:19
  • Thanks so much for being willing to help. One more piece of information: I created another blogdown project, and tried `blogdown::serve_site()`. This time the Viewer worked well. I am not sure whether it is because I accidentally changed some setup I was unaware. Surely I look forward to investigating the issue by chatting with you directly :) – Xing Zhang May 02 '18 at 15:08
  • That is even more weird... Does `blogdown::build_site()` provide any useful information? You can also open a separate R session (not in RStudio), and run `blogdown::serve_site()` on the directory of your website. – Yihui Xie May 02 '18 at 20:01
  • Thanks a lot. The error from using RGui is indeed more informative. I realized that I saved a "geoMap.csv" data under `blogdown\data`. After I removed the data from the data folder, everything is fine including the Viewer problem in RStudio. – Xing Zhang May 04 '18 at 10:12
  • Here is the essence of the error message (due to the words limit). When I ran `blogdown::serve_site()`, the error shows: Failed to read data from geoMap.csv\geoMap.csv: Data not supported for extension 'csv'... Error: Error building site: logged 1 error(s) 'C:\Users\John' is not recognized as an internal or external command, operable program or batch file. Error in shell(cmd, mustWork = TRUE, intern = intern) : '"C:\Users\John Smith\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t hugo-academic' execution failed with error code 1 – Xing Zhang May 04 '18 at 10:15
  • I see. The reason you didn't see the error message in RStudio was because RStudio had a bug: https://github.com/rstudio/rstudio/issues/2248 It has been fixed in the daily build. I think we are all set now. – Yihui Xie May 04 '18 at 14:24
  • Yup, we are all set now. Many thanks for the guidance. – Xing Zhang May 04 '18 at 15:49