Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 为什么我的服务站点没有呈现此错误?_R_Hugo_Blogdown - Fatal编程技术网

R 为什么我的服务站点没有呈现此错误?

R 为什么我的服务站点没有呈现此错误?,r,hugo,blogdown,R,Hugo,Blogdown,Hugo和Blogdown都是新手。在一个名为个人博客的新项目中我运行了 blogdown::new_site(theme=“lxndrblz/anatole”)即使在执行了blogdown::build_site()并重新启动Rstudio之后,我也会得到以下结果 C:\Users\myName\AppData\Roaming\Hugo\hugo.exe server --bind 127.0.0.1 -p 4321 --themesDir themes -t anatole -D -F --

Hugo和Blogdown都是新手。在一个名为
个人博客的新项目中
我运行了

blogdown::new_site(theme=“lxndrblz/anatole”)
即使在执行了
blogdown::build_site()
并重新启动Rstudio之后,我也会得到以下结果

C:\Users\myName\AppData\Roaming\Hugo\hugo.exe server --bind 127.0.0.1 -p 4321 --themesDir themes -t anatole -D -F --navigateToChanged
Serving the directory . at http://127.0.0.1:4321
Launched the hugo server in the background (process ID: 19844). To stop it, call blogdown::stop_server() or restart the R session.
没有一个站点格式正确。应该看起来像,但我的本地服务器上没有正确的格式。我没有看到任何CSS

编辑:关于我在下面得到的关于
Rtools
的警告——它与MinGW和我的R(4.0.3)版本有关。当我使用我的机器的默认版本R3.6.1时,什么都不工作。我下载了Rtools(据我所知,这不是一个R包,它与您从CRAN获得的完全不同)

一旦我重新安装了Rtools,将其添加到我的系统路径中,并对32位和64位版本都进行了安装,blogdown就又开始为我工作了。Blogdown并不是真正的问题,我能说的是Rtools&MinGW工作不好。现在,我将尝试开发我的博客。

在开发版本的blogdown中,您可以使用它安装(请记住重新启动R):

remotes::安装\u github('rstudio/blogdown')

这个问题是因为主题对CSS文件使用了Hugo函数
absURL
,这导致URL的形式为
http://localhost:port/path/to/css
,但该网站是从
http://127.0.0.1:port
,浏览器的CORS问题阻止了CSS文件的加载。

当我运行
remotes::install\u github('rstudio/blogdown')
时,我得到了以下警告:
警告:构建R包需要Rtools,但当前未安装。请从下载并安装Rtools 3.5https://cran.r-project.org/bin/windows/Rtools/.
我将尝试安装它,看看会发生什么。安装blogdown的开发版本不需要Rtools,因为此包不包含需要编译的代码(如C/C++)。看来你已经解决了你的问题,这是伟大的!我想我已经解决了。我感谢你的帮助。但我知道这不是博客的问题。我确实安装了blogdown::install_hugo(),但是在servr::server_config(…,baseurl=baseurl,hosturl=function(host){:未使用的参数(hosturl=function(host){if(g==“hugo”&&host==“127.0.0.1”)“localhost”中出现了一个错误else host我知道我的笔记本电脑出了问题。Blogdown上周对我来说运行良好,但显然我做错了什么。需要把它放在一边一天——盯着它看太久令人困惑。我很乐意帮忙!理论上,
remotes::install_github('rstudio/Blogdown')
应该做
remotes::install_github('yihui/servr')
自动,但似乎没有。我不知道为什么,但您可以手动运行第二个命令,然后重新启动R。我今天遇到了相同的问题。您的第二个命令解决了问题。谢谢!