无法在ruby 2.0上初始化guard-livereload

时间:2014-04-20 14:59:42

标签: ruby guard livereload

当我尝试使用

进行初始化时
guard --debug

发生以下错误。

For a better Pry experience on Windows, please use ansicon:
   http://adoxa.3eeweb.com/ansicon/
DL is deprecated, please use Fiddle
21:14:45 - INFO - You must 'gem install win32console' to use color on Windows
21:14:45 - ERROR - Could not load 'guard/livereload' or find class Guard::Livere
load
21:14:45 - ERROR - C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems
/core_ext/kernel_require.rb:126:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:126:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/http_parser.rb-0.5.3-
x86-mingw32/lib/ruby_http_parser.rb:2:in `<top (required)>'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:135:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:135:in `rescue in require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:144:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/http_parser.rb-0.5.3-
x86-mingw32/lib/http_parser.rb:2:in `<top (required)>'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:135:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:135:in `rescue in require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:144:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/http_parser.rb-0.5.3-
x86-mingw32/lib/http/parser.rb:1:in `<top (required)>'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:73:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:73:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/em-websocket-0.5.0/li
b/em-websocket/handshake.rb:1:in `<top (required)>'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:73:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:73:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/em-websocket-0.5.0/li
b/em-websocket.rb:15:in `block in <top (required)>'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/em-websocket-0.5.0/li
b/em-websocket.rb:14:in `each'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/em-websocket-0.5.0/li
b/em-websocket.rb:14:in `<top (required)>'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:73:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:73:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-livereload-2.1.
2/lib/guard/livereload/websocket.rb:2:in `<top (required)>'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:73:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:73:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-livereload-2.1.
2/lib/guard/livereload.rb:6:in `<class:LiveReload>'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-livereload-2.1.
2/lib/guard/livereload.rb:5:in `<module:Guard>'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-livereload-2.1.
2/lib/guard/livereload.rb:4:in `<top (required)>'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:135:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:135:in `rescue in require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ker
nel_require.rb:144:in `require'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard
/plugin_util.rb:100:in `plugin_class'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard
/plugin_util.rb:57:in `initialize_plugin'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard
.rb:167:in `add_plugin'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard
/dsl.rb:174:in `block in guard'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard
/dsl.rb:173:in `each'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard
/dsl.rb:173:in `guard'
> [#] C:/Users/ZAW OO/Desktop/work/Guardfile:39:in `_instance_eval_guardfile'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard
/guardfile/evaluator.rb:97:in `instance_eval'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard
/guardfile/evaluator.rb:97:in `_instance_eval_guardfile'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard
/guardfile/evaluator.rb:37:in `evaluate_guardfile'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard
/setuper.rb:146:in `evaluate_guardfile'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard
/setuper.rb:64:in `setup'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard
/commander.rb:24:in `start'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard
/cli.rb:107:in `start'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/
command.rb:27:in `run'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/
invocation.rb:126:in `invoke_command'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor.
rb:359:in `dispatch'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/
base.rb:440:in `start'
> [#] C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/bin/guard
:6:in `<top (required)>'
> [#] C:/RailsInstaller/Ruby2.0.0/bin/guard:23:in `load'
> [#] C:/RailsInstaller/Ruby2.0.0/bin/guard:23:in `<main>'
21:14:45 - ERROR - Invalid Guardfile, original error is:
> [#] undefined method `superclass' for nil:NilClass
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/lib/guard/plugi
n_util.rb:57:in `initialize_plugin': undefined method `superclass' for nil:NilCl
ass (NoMethodError)
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/li
b/guard.rb:167:in `add_plugin'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/li
b/guard/dsl.rb:174:in `block in guard'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/li
b/guard/dsl.rb:173:in `each'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/li
b/guard/dsl.rb:173:in `guard'
        from C:/Users/ZAW OO/Desktop/work/Guardfile:39:in `_instance_eval_guardf
ile'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/li
b/guard/guardfile/evaluator.rb:97:in `instance_eval'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/li
b/guard/guardfile/evaluator.rb:97:in `_instance_eval_guardfile'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/li
b/guard/guardfile/evaluator.rb:37:in `evaluate_guardfile'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/li
b/guard/setuper.rb:146:in `evaluate_guardfile'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/li
b/guard/setuper.rb:64:in `setup'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/li
b/guard/commander.rb:24:in `start'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/li
b/guard/cli.rb:107:in `start'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/thor-0.19.1/li
b/thor/command.rb:27:in `run'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/thor-0.19.1/li
b/thor/invocation.rb:126:in `invoke_command'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/thor-0.19.1/li
b/thor.rb:359:in `dispatch'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/thor-0.19.1/li
b/thor/base.rb:440:in `start'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/guard-2.6.0/bi
n/guard:6:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.0.0/bin/guard:23:in `load'
        from C:/RailsInstaller/Ruby2.0.0/bin/guard:23:in `<main>'

这是我的警卫档案

# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'sass', :input => 'sass', :output => 'css'

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

但是当我在guardfile中为livereload部分留空时,它正常工作。我也尝试安装Win32console,但是包没有出现,后来我发现它不需要ruby 2.我在ruby 2.0.0p195(2013-05-14)[i386-mingw32]下运行在64位(窗口7)。

0 个答案:

没有答案