我是E blogdown软件包的新手。我有一本关于本书的第一章。我尝试使用以下网站制作新网站:
new_site(dir = "E:/data/R/EconStats", install_hugo = TRUE, format = "toml",
+ sample = TRUE, theme = "yihui/hugo-xmin", theme_example = TRUE,
+ serve = interactive())
但它返回错误:
Congratulations! Your new Hugo site is created in E:\data\R\EconStats.
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-xmin/archive/master.zip'
Content type 'application/zip' length 78939 bytes (77 KB)
downloaded 77 KB
Rendering content/_index.Rmarkdown
Warning message:
In eval(quote({ :
The xaringan package is not installed. LaTeX math may not work well.
Rendering content/post/2015-07-23-r-rmarkdown.Rmd
[1] FALSE
Warning message:
In file.create(to[okay]) :
cannot create file '../README.md', reason 'Permission denied'
/usr/bin/sed: can't read : No such file or directory
/usr/bin/sed: can't read ../README.md: Permission denied
Warning message:
running command 'sed -i '' -e '1,6d' -e '34,38d' ../README.md' had status 2
Error in file(file, ifelse(append, "a", "w")) :
cannot open the connection
Calls: cat -> file
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
cannot open file '../README.md': Permission denied
Execution halted
Error in run_script("R/build.R", as.character(local)) :
Failed to run R/build.R
In addition: Warning message:
running command '"C:/PROGRA~1/R/R-34~1.2/bin/x64/Rscript" "R/build.R" TRUE' had status 1
我试图更新雨果。 我也尝试使用Rstudio创建项目等创建网站...使用这种方式,我可以创建网站,但如果我调用blogdown :: server_site()`函数,它会重新报错。
编辑:
我提供sessionInfo()
的结果:
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Croatian_Croatia.1250 LC_CTYPE=Croatian_Croatia.1250 LC_MONETARY=Croatian_Croatia.1250
[4] LC_NUMERIC=C LC_TIME=Croatian_Croatia.1250
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.2 backports_1.1.1 magrittr_1.5 bookdown_0.5 rprojroot_1.2 htmltools_0.3.6 tools_3.4.2
[8] rstudioapi_0.7 yaml_2.1.14 Rcpp_0.12.13 stringi_1.1.5 rmarkdown_1.6 blogdown_0.1 knitr_1.17
[15] stringr_1.2.0 digest_0.6.12 evaluate_0.10.1
答案 0 :(得分:3)
您可以安全地删除R脚本R/build.R
,然后再次运行serve_site()
。
setwd("E:/data/R/EconStats") # try RStudio Project to avoid setwd() every time
blogdown::serve_site()