【发布时间】:2012-08-11 10:40:18
【问题描述】:
我想开始学习 JS。 我找到了 gem guard-livereload。
在我的 Rails 应用程序中,它运行良好。但我想用它为简单的 JS 脚本重新加载本地文件。
所以我将guard-livereload 安装到 rvm gemset global。创建新目录javascript
添加到Guardfile
# https://github.com/guard/guard-livereload
guard :livereload do
watch(%r{.+\.(html|css|js)$})
end
使用 Livereload 扩展 (1.6) 打开 Chrome
这是来自我的控制台:
> guard /Users/rege/Code/javascript 1.9.3p194 @
Guard could not detect any of the supported notification libraries.
Guard is now watching at '/Users/rege/Code/javascript'
LiveReload 1.6 is waiting for a browser to connect.
Browser connected.
Browser URL: file://localhost/Users/rege/Code/javascript/examples/example_1_2.html
Reloading browser: examples/example_1_2.html
Reloading browser: examples/example_1_2.html
Reloading browser: examples/example_1_2.html
我的卫士版本:
> gem list guard /Users/rege/Code/javascript 1.9.3p194 @
*** LOCAL GEMS ***
guard (1.3.0)
guard-livereload (1.0.0)
似乎一切正常,但 Chrome 不刷新页面。
【问题讨论】:
-
它也对我不起作用。我发现这个适用于 Firefox 的插件也适用于 JavaScript:stackoverflow.com/questions/8710613/…
-
您的问题帮助我使用了livereload,谢谢! (我不知道我必须运行
guard命令)
标签: javascript ruby google-chrome google-chrome-extension guard