Chrome LiveReload扩展/ guard-livereload断开浏览器

时间:2013-04-11 02:38:02

标签: google-chrome guard livereload

将guard-livereload连接到浏览器时遇到问题。每次我尝试启用LiveReload插件时,它都会连接到浏览器并自动断开连接。 LiveReload然后显示:

http://img21.imageshack.us/img21/2265/bugqf.png

我的Guardfile:

    guard 'livereload' do
        watch(%r{.+\.(html|css|js)$})
    end

控制台输出:

PS D:\workspace\xampp\htdocs\lab\test-menu> guard
04:22:12 - INFO - Guard uses TerminalTitle to send notifications.
04:22:12 - INFO - Guard is now watching at 'D:/workspace/xampp/htdocs/lab/test-menu'
04:22:12 - INFO - LiveReload 1.6 is waiting for a browser to connect.
[Listen warning]:
  Missing dependency 'wdm' (version '~> 0.1')!
  Please run the following to satisfy the dependency:
    gem install --version '~> 0.1' wdm

  For a better performance, it's recommended that you satisfy the missing dependency.
  Listen will be polling changes. Learn more at https://github.com/guard/listen#polling-fallback.

[1] guard(main)> 04:22:17 - INFO - Browser connected.
04:22:18 - INFO - Browser disconnected.
04:22:21 - INFO - Browser connected.
04:22:22 - INFO - Browser disconnected.
04:22:24 - INFO - Browser connected.
04:22:25 - INFO - Browser disconnected.

版本:

  • 后卫:1.7.0
  • livereload:2.0.9
  • chrome:26.0.1410.64 m
  • windows:8

抱歉我的英语不好。谢谢,亚当。

2 个答案:

答案 0 :(得分:0)

一旦你已经使用了Guard和livereload,你可以使用rack-livereload gem替代插件。它可能看起来有点难以配置,但如果您按照其Github页面中的说明进行操作,您将立即进行实时重载。

它的可用性: https://github.com/johnbintz/rack-livereload

答案 1 :(得分:0)

在从Chromium切换到Chrome并通过执行

修复后,我刚才遇到了同样的问题
gem install guard guard-livereload

不确定问题是什么 - 我也有一些依赖警告,像你一样,他们仍然出现

WARN: Unresolved specs during Gem::Specification.reset:
      thor (>= 0.14.6)
      ffi (>= 0.5.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.

但无论如何,浏览器现在连接时不会立即断开连接。

注意:我正在通过RVM使用Ruby设置。