【问题标题】:Problem rendering Hugo Lithium theme (blogdown), "Acess denied"渲染 Hugo Lithium 主题(博客)时出现问题,“访问被拒绝”
【发布时间】:2021-01-22 21:12:19
【问题描述】:

我正在尝试使用 blogdown 更新网站。但是,渲染失败。网站仓库在this link

当我运行blogdown:::serve_site() 时,我收到以下错误:

Start building sites … 
ERROR 2020/10/07 15:19:06 open C:\Users\jaime\Documents\R\EstadisticaDescriptiva\public\2020\10\03\estadística-descriptiva-ejercicio\index.html: Access is denied.
ERROR 2020/10/07 15:19:06 open C:\Users\jaime\Documents\R\EstadisticaDescriptiva\public\index.html: Access is denied.
ERROR 2020/10/07 15:19:06 open C:\Users\jaime\Documents\R\EstadisticaDescriptiva\public\post\index.html: Access is denied.
ERROR 2020/10/07 15:19:06 open C:\Users\jaime\Documents\R\EstadisticaDescriptiva\public\categories\index.html: Access is denied.
Total in 366 ms
Error: Error building site: failed to render pages: open C:\Users\jaime\Documents\R\EstadisticaDescriptiva\public\about\index.html: Access is denied.
Start building sites … 
ERROR 2020/10/07 15:19:07 open C:\Users\jaime\Documents\R\EstadisticaDescriptiva\public\2020\10\03\estadística-descriptiva-ejercicio\index.html: Access is denied.
ERROR 2020/10/07 15:19:07 open C:\Users\jaime\Documents\R\EstadisticaDescriptiva\public\2020\02\10\estadística-desciptiva-en-python\index.html: Access is denied.
ERROR 2020/10/07 15:19:07 open C:\Users\jaime\Documents\R\EstadisticaDescriptiva\public\post\index.html: Access is denied.
ERROR 2020/10/07 15:19:07 open C:\Users\jaime\Documents\R\EstadisticaDescriptiva\public\categories\index.html: Access is denied.
Total in 390 ms
Error: Error building site: failed to render pages: open C:\Users\jaime\Documents\R\EstadisticaDescriptiva\public\about\index.html: Access is denied.
El sistema no puede encontrar la ruta especificada.
Error in shell(cmd, mustWork = TRUE, intern = intern) : 
  '"C:\Users\jaime\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" --themesDir themes -t hugo-lithium' execution failed with error code 1

我尝试从一开始就使用blogdown::new_site(theme = 'usjrutheiser/hugo-lithium-theme') 创建一个新网站,但出现以下错误:

Error in if (dir_exists(expdir)) if (theme_example) { : 
  argument is of length zero
In addition: Warning messages:
1: In download.file(url, output, ..., method = method) :
  cannot open URL 'https://github.com/usjrutheiser/hugo-lithium-theme/archive/master.tar.gz': HTTP status was '404 Not Found'
2: In download.file(url, output, ..., method = method) :
  cannot open URL 'https://github.com/usjrutheiser/hugo-lithium-theme/archive/master.tar.gz': HTTP status was '404 Not Found'
3: In download.file(url, output, ..., method = method) :
  cannot open URL 'https://github.com/usjrutheiser/hugo-lithium-theme/archive/master.tar.gz': HTTP status was '404 Not Found'
4: In utils::untar(zipfile, exdir = tmpdir) :
  ‘tar.exe -xf "2ff459957c97master.tar.gz" -C "2ff46b705392"’ returned error code 1

我在一台带有 R 3.6.3 的旧 PC 中渲染该站点,并且它可以工作,但在我的新 PC (R 4.0.2) 中却不能。 有谁知道这个“拒绝访问错误”是什么意思?如何修复这些错误?


编辑

我使用过其他的锂主题存储库,我使用 RStudio 来创建它

但是,我遇到了同样的问题

Congratulations! Your new Hugo site is created in C:\Users\jaime\Documents\R\EjemplosEstadística.

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/archive/master.tar.gz'
downloaded 109 KB

processing 7 content files
Error: Failed to save file "C:\\Users\\jaime\\Documents\\R\\EjemplosEstadística\\content\\post\\2016-12-30-hello-markdown.md":: open C:\Users\jaime\Documents\R\EjemplosEstadística\content\post\2016-12-30-hello-markdown.md: Access is denied.
processing 7 content files
Error: Failed to save file "C:\\Users\\jaime\\Documents\\R\\EjemplosEstadística\\content\\post\\2016-12-30-hello-markdown.md":: open C:\Users\jaime\Documents\R\EjemplosEstadística\content\post\2016-12-30-hello-markdown.md: Access is denied.
processing 7 content files
Error: Failed to save file "C:\\Users\\jaime\\Documents\\R\\EjemplosEstadística\\content\\post\\2016-12-30-hello-markdown.md":: open C:\Users\jaime\Documents\R\EjemplosEstadística\content\post\2016-12-30-hello-markdown.md: Access is denied.
Error in shell(cmd, mustWork = TRUE, intern = intern) : 
  '"C:\Users\jaime\AppData\Roaming\Hugo\hugo.exe" convert toYAML --unsafe' execution failed with error code 65535

【问题讨论】:

  • 看起来这些链接根本不起作用了。如果您尝试错误消息中的其中一个 URL,您将收到 404 错误。
  • 是的,但为什么它适用于其他 R 版本?会不会是 Hugo 版本的问题?
  • 这确实令人困惑,也许数据是从其他地方检索到的。与此同时,也许你可以试试这个 fork:github.com/yihui/hugo-lithium?
  • 谢谢@Knak,它对我不起作用:(

标签: r r-markdown knitr hugo blogdown


【解决方案1】:

出现这种问题是因为防病毒和防火墙应用程序(我没有告诉你我使用的是Windows 10)。之前,我禁用了我的防病毒软件一段时间,但它不起作用。

解决方案是为 R 和 RStudio 添加一个例外,而不是为 hugo.exe 添加一个例外。

最好的祝愿。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-17
    • 2013-08-15
    • 1970-01-01
    相关资源
    最近更新 更多