我正在尝试在 Windows 10 计算机上设置 Jekyll,但无法连接到由以下人员创建的网站 (127.0.0.1:4000)jekyll serve
(or bundle exec jekyll serve
)。我已遵循 Julian Thilo 的所有步骤在 Windows 上运行 Jekyll http://jekyll-windows.juthilo.com/没有任何错误消息。当我跑步时jekyll serve
在我的 Jekyll 网站文件夹中的 PowerShell 中,一切似乎都很好:
Configuration file: C:/Users/fredr/dropbox/github/jekyll-website/_config.yml
Source: C:/Users/fredr/dropbox/github/jekyll-website
Destination: C:/Users/fredr/dropbox/github/jekyll-website/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.457 seconds.
Auto-regeneration: enabled for 'C:/Users/fredr/dropbox/github/jekyll-website'
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
但当我打开http://127.0.0.1:4000 http://127.0.0.1:4000 (or http://本地主机:4000 http://localhost:4000)在我的浏览器中,连接失败。
当我跑步时netstat -an
, 港口4000
被列为
Proto Local Address Foreign Address State
TCP 127.0.0.1:4000 0.0.0.0:0 LISTENING
我之前曾设法使用 IIS 设置本地主机,但该网站现在已停止。
这个 Github 问题 https://github.com/Microsoft/WSL/issues/1285似乎相关,但没有包含足够的信息让我弄清楚问题是如何解决的。它只说使用“Jekyll on windows package”,但我找不到任何相关信息。
跟随 @Fredrik P 的脚步,我进入了该项目_site
文件夹(这是服务器的主文件夹所在的位置)并运行一个 Python 3.x 简单 HTTP 服务器:
D:\frida\frida-website\_site>python -m http.server 3999
Serving HTTP on 0.0.0.0 port 3999 (http://0.0.0.0:3999/) ...
现在将我的浏览器指向http://0.0.0.0:3999/
奇迹般有效。
如果您需要使用 Python 2.x,HTTP 服务器命令将为:
python -m SimpleHTTPServer 3999
有关更多信息SimpleHTTPServer
(2.x) 和http.server
(3.x),参见这个堆栈溢出帖子 https://stackoverflow.com/q/7943751/562242.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)