我想开始学习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 扩展的 Chrome (1.6)
这是来自我的控制台:
> 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 不会刷新页面。