Question :
I’m trying to create a site to post descriptive analyzes done in R, using the Hugo theme. However, after creating a .rmd post where I read a .csv file and do a series of reviews. I get this error when using the serve_site () or build_site () command
Warning message:
In readLines(if (is.character(input2)) { :
entrada inválida na conexão de entrada '2018-09-12-hello-world.Rmd'
Building sites … ERROR 2018/09/12 22:23:23 Failed to read data from
__h__projectalex_turner.csvalex_turner.csv: Data not supported for
extension 'csv'
Total in 262 ms
Error: Error building site: logged 1 error(s)
Building sites … ERROR 2018/09/12 22:23:24 Failed to read data from
__h__projectalex_turner.csvalex_turner.csv: Data not supported for
extension 'csv'
Total in 103 ms
Error: Error building site: logged 1 error(s)
O sistema nÆo pode encontrar o caminho especificado.
Error in shell(cmd, mustWork = TRUE, intern = intern) :
'"C:UserserickAppDataRoamingHugohugo.exe" -d
"../erickrdgs.github.io" -t hugo-tranquilpeak-theme' execution failed with
error code 1
In addition: Warning messages:
1: In read_utf8(f) :
The file content/post/2018-09-12-hello-world.Rmd is not encoded in UTF-8.
These lines contain invalid UTF-8 characters: 33, 35, 37, 48, 50, 73, ...
2: running command '"C:UserserickAppDataRoamingHugohugo.exe" -d
"../erickrdgs.github.io" -t hugo-tranquilpeak-theme' had status 65535
3: running command '"C:UserserickAppDataRoamingHugohugo.exe" -d
"../erickrdgs.github.io" -t hugo-tranquilpeak-theme' had status 65535
4: running command 'C:WINDOWSsystem32cmd.exe /c
"C:UserserickAppDataRoamingHugohugo.exe" -d "../erickrdgs.github.io" -
t hugo-tranquilpeak-theme' had status 1
The file alex_turner.csv exists and is inside a ‘date’ folder in the project root. Does anyone know what can cause this error and how can I resolve it?
The repository for the project in question is link
Answer :
Apparently your code is correct. I ran it on my PC (it’s a Mac, actually), and at least the special characters (like in music, for example), everything worked out:
Thisdrewmyattentiontosomepossiblecharacterencodingproblem.Notethefollowinglineintheerrormessagethatisinyourpost:
Thefilecontent/post/2018-09-12-hello-world.RmdisnotencodedinUTF-8
Bingo.That’stheproblem.WhatIdidtosolveitwasasfollows:
Iopenedthecontent/2018-09-12-hello-world.Rmd
fileinRStudio
IwenttothemenuFile>SavewithEncoding...
andchosetheUTF-8option
IclosedRStudioandreopened
Iranthecommandblogdown::build_site();blogdown::serve_site()
andtheresultwasasfollows:
Note that now the special characters appear all (songs turned into songs, as they should be).
As you use Windows, my solution is that every file you create in RStudio will now be saved through the Save with Encoding...
option with the UTF-8 option. For some reason I do not know, Windows still does not use UTF-8 as a character encoding, which causes a lot of bizarre problems when other programs, such as Hugo, try to access text files made in a Windows editor. >