Mislav
Mislav

Reputation: 1563

Error in using blogdown new_stite() function

I am new to E blogdown package. I have rad 1st chapter of bogdown book. I tried to make new site using:

new_site(dir = "E:/data/R/EconStats", install_hugo = TRUE, format = "toml", 
+          sample = TRUE, theme = "yihui/hugo-xmin", theme_example = TRUE, 
+          serve = interactive())

but it returns an error:

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

I have tried to update Hugo. I have also tried to create website using Rstudio create Project etc... Using this way, I can make web site but it retnuns above error if I call blogdown::server_site()` function.

EDIT:

I provide result of 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

Upvotes: 1

Views: 670

Answers (1)

Yihui Xie
Yihui Xie

Reputation: 30114

You can safely delete the R script R/build.R, and run serve_site() again.

setwd("E:/data/R/EconStats") # try RStudio Project to avoid setwd() every time
blogdown::serve_site()

Upvotes: 3

Related Questions