我是一个博客乞讨者,我不能开始,因为我认为我的会话的问题不能使用hugo.exe
在RStudio中,我创建了一个新项目,并在该项目中运行以下代码,输出如下:
dir.create("Web")
setwd("Web")
blogdown::new_site()
The latest Hugo version is 0.38.2
trying URL 'https://github.com/gohugoio/hugo/releases/download/v0.38.2/hugo_0.38.2_Windows 64bit.zip'
length 6164680 bytes (5.9 MB)
downloaded 5.9 MB
Hugo has been installed to C:\Users\Rod\AppData\Roaming\Hugo
Error in if (grepl(r, x)) return(as.numeric_version(gsub(r, "\\1", x))) :
argument is of length zero当我再次尝试运行blogdown::new_site()时,它会给我这样的结果:
'C:\Users\Rod\AppData\Roaming\Hugo\hugo.exe" new site ".' is not recognized
as an internal or external command, operable program or batch file.
Error in shell(cmd, mustWork = TRUE, intern = intern) :
'"C:\Users\Rod\AppData\Roaming\Hugo\hugo.exe" new site "." --force -f toml'
execution failed with error code 1
In addition: Warning messages:
1: running command '"C:\Users\Rod\AppData\Roaming\Hugo\hugo.exe" new site "." --force -f toml' had status 65535
2: running command '"C:\Users\Rod\AppData\Roaming\Hugo\hugo.exe" new site "." --force -f toml' had status 65535
3: running command 'C:\WINDOWS\system32\cmd.exe /c
"C:\Users\Rod\AppData\Roaming\Hugo\hugo.exe" new site "." --force -f toml'
had status 1 我自己安装了hugo,并使用:
options(blogdown.hugo.dir = "C:\\Hugo\bin")
install_hugo()我还让install_hugo()在绑定中执行默认安装。
我还将其添加为系统环境变量,但似乎都不起作用。
有什么帮助吗?
奇怪的是,我可以这样做:
shell(paste("C:\\Users\\Rod\\AppData\\Roaming\\Hugo\\hugo.exe", 'version'))
Hugo Static Site Generator v0.38.2 windows/amd64 BuildDate: 2018-04-
09T08:17:46Z编辑:通过重新安装所有文件,并在新项目和空目录中再次运行,new_page()创建了所有文件,但给了我以下内容,但我怀疑是相同的问题:
blogdown::new_site()
trying URL 'https://github.com/yihui/hugo-lithium-theme/archive/master.zip'
Content length 119078 bytes (116 KB)
downloaded 116 KB
Rendering content/post/2015-07-23-r-rmarkdown.Rmd
The system cannot find the path specified.
Error in shell(cmd, mustWork = TRUE, intern = intern) :
'"C:\Users\Rod\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t hugo-lithium-theme' execution failed with error code 1
In addition: Warning messages:
1: running command '"C:\Users\Rod\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t hugo-lithium-theme' had status 65535
2: running command '"C:\Users\Rod\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t hugo-lithium-theme' had status 65535
3: running command 'C:\WINDOWS\system32\cmd.exe /c "C:\Users\Rod\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t hugo-lithium-theme' had status 1sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
other attached packages:
[1] blogdown_0.5.15
loaded via a namespace (and not attached):
[1] httr_1.3.1 compiler_3.4.4 bookdown_0.7
[4] R6_2.2.2 tools_3.4.4 withr_2.1.2
[7] curl_3.2 yaml_2.1.18 memoise_1.1.0
[10] knitr_1.20 git2r_0.21.0 xfun_0.1
[13] digest_0.6.15 devtools_1.13.5发布于 2018-05-26 07:29:08
如果您使用的是OneDrive,并且OneDrive处于“文件随需应变”云同步模式,则可能会出现此错误。Blogdown从Hugo继承了这一点,Hugo本身也继承了Go的行为。有关完整的详细信息,请参阅Hugo问题讨论:
https://github.com/gohugoio/hugo/issues/4079
这里的建议是,这个问题将在即将到来的Go更新中修复,该更新可能会渗透到Hugo中,因此在适当的时候会被注销。
同时,如果你使用的是OneDrive,我的选择是把它从“文件点播”同步模式切换出来。为此,打开OneDrive设置,转到设置选项卡,应该会有一个文件按需复选框。如果取消选中,它将下载所有文件,然后Go将能够看到真正的文件夹。
https://stackoverflow.com/questions/49762787
复制相似问题