Jekyll 杰基尔';s"--“自动”;不';不行?

Jekyll 杰基尔';s"--“自动”;不';不行?,jekyll,Jekyll,我刚刚重新安装了我的整个系统,并重新开始我的项目。我在其中一些应用程序中使用了Jekyll,但在使用--auto或\u config.yml的auto:true自动生成时遇到了问题。它根本不起作用。jekyll--server--auto的输出是: Configuration from /home/rafal/Documents/Projects/ruby-adventure/_config.yml Auto-regenerating enabled: /home/rafal/Documents

我刚刚重新安装了我的整个系统,并重新开始我的项目。我在其中一些应用程序中使用了Jekyll,但在使用
--auto
\u config.yml
auto:true
自动生成时遇到了问题。它根本不起作用。
jekyll--server--auto
的输出是:

Configuration from /home/rafal/Documents/Projects/ruby-adventure/_config.yml
Auto-regenerating enabled: /home/rafal/Documents/Projects/ruby-adventure -> /home/rafal/Documents/Projects/ruby-adventure/_site
[2013-03-23 19:09:53] regeneration: 1 files changed
[2013-03-23 19:09:53] INFO  WEBrick 1.3.1
[2013-03-23 19:09:53] INFO  ruby 2.0.0 (2013-02-24) [x86_64-linux]
[2013-03-23 19:09:53] WARN  TCPServer Error: Address already in use - bind(2)
[2013-03-23 19:09:53] INFO  WEBrick::HTTPServer#start: pid=3288 port=4000
[2013-03-23 19:09:53] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
Configuration from /home/rafal/Documents/Projects/ruby-adventure/_config.yml
Building site: /home/rafal/Documents/Projects/ruby-adventure -> /home/rafal/Documents/Projects/ruby-adventure/_site
Successfully generated site: /home/rafal/Documents/Projects/ruby-adventure -> /home/rafal/Documents/Projects/ruby-adventure/_site
[2013-03-23 19:12:31] INFO  WEBrick 1.3.1
[2013-03-23 19:12:31] INFO  ruby 2.0.0 (2013-02-24) [x86_64-linux]
[2013-03-23 19:12:31] WARN  TCPServer Error: Address already in use - bind(2)
[2013-03-23 19:12:31] INFO  WEBrick::HTTPServer#start: pid=3327 port=4000
jekyll--no auto--server
的输出为:

Configuration from /home/rafal/Documents/Projects/ruby-adventure/_config.yml
Auto-regenerating enabled: /home/rafal/Documents/Projects/ruby-adventure -> /home/rafal/Documents/Projects/ruby-adventure/_site
[2013-03-23 19:09:53] regeneration: 1 files changed
[2013-03-23 19:09:53] INFO  WEBrick 1.3.1
[2013-03-23 19:09:53] INFO  ruby 2.0.0 (2013-02-24) [x86_64-linux]
[2013-03-23 19:09:53] WARN  TCPServer Error: Address already in use - bind(2)
[2013-03-23 19:09:53] INFO  WEBrick::HTTPServer#start: pid=3288 port=4000
[2013-03-23 19:09:53] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
Configuration from /home/rafal/Documents/Projects/ruby-adventure/_config.yml
Building site: /home/rafal/Documents/Projects/ruby-adventure -> /home/rafal/Documents/Projects/ruby-adventure/_site
Successfully generated site: /home/rafal/Documents/Projects/ruby-adventure -> /home/rafal/Documents/Projects/ruby-adventure/_site
[2013-03-23 19:12:31] INFO  WEBrick 1.3.1
[2013-03-23 19:12:31] INFO  ruby 2.0.0 (2013-02-24) [x86_64-linux]
[2013-03-23 19:12:31] WARN  TCPServer Error: Address already in use - bind(2)
[2013-03-23 19:12:31] INFO  WEBrick::HTTPServer#start: pid=3327 port=4000

…所以不会出现错误。该网站生成良好,但当我更改文件时,它不会自动重新生成。你知道为什么吗?

似乎是由于最近对目录监视程序gem的更改引起的。回滚gem修复了我的问题:

sudo gem uninstall directory_watcher && sudo gem install directory_watcher -v 1.4.1

我可以通过按照@lilakai硬锁定目录_watcher gem来修复此问题,但我采用了不同的方法:

将此行添加到我的gemfile(在开发组中):

然后跑:

bundle update directory_watcher
一旦我这么做了,一切都正常了(因为它将我的版本锁定为1.4,我通过Gemfile.lock确认了这一点)。我更喜欢通过bundler直接管理所有gem,而不是通过systemruby


在撰写本文时,我使用最新版本的Octopress()遇到了这个问题。

是的,可以复制。服务器有时需要在文件更改后重新启动,否则它无法接收更改。在GitHub项目页面上提交一个bug。您使用的是哪个Jekyll版本?0.12.1? 我使用了它,它工作正常,也就是说,在编辑和保存被监视的文件后,它会重新生成。
jekyll--no auto--server
的结果不应包括
regenation:1 files changed
语句。得到与0.12.1相同的问题。然而,非常奇怪的是,每当我保存
\u config.yml
,它就会突然拾取在其他地方所做的所有更改,并按其应该的方式重新生成文件。有人也这样吗?是的,也帮我修了。谢谢这是可行的,但现在它无休止地循环“5个文件已更改”,而不保存任何文件。想法?@JoelGrannas安装v1.0.0.beta4,它应该被修复!这是我的解决方案,只是我必须从该命令中删除
sudo
s。否则,在尝试卸载时,我收到消息
INFO:gem“directory\u watcher”未安装
。这可能与我的
GEM_HOME
/usr/local/
有关。对于那些使用RVM的人,不要忘记删除两个
sudo
GEM uninstall directory_watcher&&GEM install directory_watcher-v1.4.1
(我想是@Jian)上帝感谢你发布这篇文章,刚刚修复了我的
rake watch
循环错误。我将我的目录监视程序设置为1.4.4