我正在尝试使用guard uglify javascript,但出现以下错误:
错误 - Guard::Uglify 未能实现它,异常是:[#] JSON::GeneratorError: 只允许生成 JSON 对象或数组 [#] C:/Ruby193/lib/ruby/1.9.1/json/common。 rb:216:in
generate' [#] C:/Ruby193/lib/ruby/1.9.1/json/common.rb:216:in
generate' [#] C:/Ruby193/lib/ruby/1.9.1/json/common.rb:352:indump' [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.0.0/lib/execjs/external_runtime.rb:53:in
block (2 levels) in compile' [#] C:/Ruby193/lib/ ruby/gems/1.9.1/gems/execjs-2.0.0/lib/execjs/external_runtime.rb:51:insub!' [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.0.0/lib/execjs/external_runtime.rb:51:in
block in compile' [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems /execjs-2.0.0/lib/execjs/external_runtime.rb:47:intap' [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.0.0/lib/execjs/external_runtime.rb:47:in
compile'
我正在使用 json 2.0.0(也尝试过 1.8.0)和 mutli-json 1.7.8(也尝试过 1.7.9)
编辑
Guardfile 中的代码
guard 'uglify', :destination_file => "js/scripts.min.js" do
watch 'js/scripts.min.js'
end