R blogdown new_site()抛出错误

时间:2018-03-10 18:06:27

标签: r blogdown

如果我尝试运行blogdown::new_site()我收到一条错误消息我怀疑是linux / windows转换问题的斜杠可能吗?

blogdown::new_site()
Congratulations! Your new Hugo site is created in D:\Documents\Blog.

Just a few more steps and you're ready to go:

1. Download a theme into the same-named folder.
   Choose a theme from https://themes.gohugo.io/, or
   create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
   with "hugo new <SECTIONNAME>\<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".

Visit https://gohugo.io/ for quickstart guide and full documentation.
trying URL 'https://github.com/yihui/hugo-lithium-theme/archive/master.zip'
Content length 119078 bytes (116 KB)
downloaded 116 KB

Error in gsub(tmpdir, ".", zipdir) : 
  invalid regular expression '.\3aec55bc496d', reason 'Invalid back reference'

没有完全了解那里发生的事情...我在空目录上的命令并通过Rstudio绑定它也尝试了另一个模板gcushen/hugo-academic,这导致了相同的错误消息。 ..

我在Windows机器上运行R所有软件包都是最新的我相信...

sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

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

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

other attached packages:
[1] blogdown_0.5.9

loaded via a namespace (and not attached):
[1] compiler_3.4.3 bookdown_0.7   tools_3.4.3    yaml_2.1.18    knitr_1.20     xfun_0.1   

1 个答案:

答案 0 :(得分:2)

正如我的评论中提到的,这确实是博客中的一个错误,可以追溯到Windows和Unix如何处理路径名中的斜杠(或者更具体地说,tempfile()utils::unzip()如何处理的差异在Windows上的输出中斜杠。)

现在应该从blogdown版本0.5.10开始修复此问题,您可以使用devtools::install_github("rstudio/blogdown")进行安装。