使用 blogdown new_stite() 函数时出错
Error in using blogdown new_stite() function
我是 E blogdown 软件包的新手。我读了 bogdown 书的第一章。我尝试使用以下方法创建新站点:
new_site(dir = "E:/data/R/EconStats", install_hugo = TRUE, format = "toml",
+ sample = TRUE, theme = "yihui/hugo-xmin", theme_example = TRUE,
+ serve = interactive())
但它 returns 一个错误:
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
我已经尝试更新 Hugo。
我还尝试使用 Rstudio create Project 等创建网站...使用这种方式,我可以制作网站,但如果我调用 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
您可以安全地删除 R 脚本 R/build.R
,然后再次 运行 serve_site()
。
setwd("E:/data/R/EconStats") # try RStudio Project to avoid setwd() every time
blogdown::serve_site()
我是 E blogdown 软件包的新手。我读了 bogdown 书的第一章。我尝试使用以下方法创建新站点:
new_site(dir = "E:/data/R/EconStats", install_hugo = TRUE, format = "toml",
+ sample = TRUE, theme = "yihui/hugo-xmin", theme_example = TRUE,
+ serve = interactive())
但它 returns 一个错误:
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
我已经尝试更新 Hugo。 我还尝试使用 Rstudio create Project 等创建网站...使用这种方式,我可以制作网站,但如果我调用 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
您可以安全地删除 R 脚本 R/build.R
,然后再次 运行 serve_site()
。
setwd("E:/data/R/EconStats") # try RStudio Project to avoid setwd() every time
blogdown::serve_site()