cjohansen / juicer

A command line tool for JavaScript and CSS developers
630 stars 47 forks source link

Unable to minify JS #58

Closed AlexSkrypnyk closed 12 years ago

AlexSkrypnyk commented 12 years ago

Thanks for the great tool.

I'm using Windows and CSS minification works perfectly, bu I have a problem with minifying JS - there is an error produced (see below) and minified file is not created.

c:\t\j>juicer merge scripts.js
Verifying c:/t/j/scripts.js with JsLint
"---"
"TEST OUTPUT OF "#{self.command} #{params}" "
"java  -jar \"C:/Users/Alex/.juicer/lib/rhino/bin/rhino1_7R3.jar\" \"C:/Users/Al
ex/.juicer/lib/jslint/bin/jslint-1.0.js\" \"c:/t/j/scripts.js\""
"---"
C:/Ruby193/lib/ruby/gems/1.9.1/gems/juicer-1.0.16/lib/juicer/binary.rb:36:in `po
pen': No such file or directory - java  -jar "C:/Users/Alex/.juicer/lib/rhino/bi
n/rhino1_7R3.jar" "C:/Users/Alex/.juicer/lib/jslint/bin/jslint-1.0.js" "c:/t/j/s
cripts.js" (Errno::ENOENT)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/juicer-1.0.16/lib/juicer/binary
.rb:36:in `execute'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/juicer-1.0.16/lib/juicer/jslint
.rb:35:in `check'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/juicer-1.0.16/lib/juicer/comman
d/verify.rb:45:in `block in check_all'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/juicer-1.0.16/lib/juicer/comman
d/verify.rb:43:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/juicer-1.0.16/lib/juicer/comman
d/verify.rb:43:in `check_all'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/juicer-1.0.16/lib/juicer/comman
d/merge.rb:122:in `execute'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/cmdparse-2.0.5/lib/cmdparse.rb:
464:in `parse'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/juicer-1.0.16/lib/juicer/cli.rb
:27:in `parse'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/juicer-1.0.16/lib/juicer/cli.rb
:37:in `run'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/juicer-1.0.16/bin/juicer:6:in `
<top (required)>'
        from C:/Ruby193/bin/juicer:23:in `load'
        from C:/Ruby193/bin/juicer:23:in `<main>'

As you can see, I've inserted some test output in the beginning to grab what files it cannot find. When these params are ran from cmd as normal command, there is no error.

I.e.

c:\t\j>java -jar "C:/Users/Alex/.juicer/lib/rhino/bin/rhino1_7R3.jar" "C:/Users/Alex/.juicer/lib/jslint/bin/jslint-1.0.js" "c:/t/j/scripts.js" jslint: No problems found in c:/t/j/scripts.js

Please help to identify the reason as the output line

C:/Ruby193/lib/ruby/gems/1.9.1/gems/juicer-1.0.16/lib/juicer/binary.rb:36:in `po
pen': No such file or directory - java  -jar "C:/Users/Alex/.juicer/lib/rhino/bi
n/rhino1_7R3.jar" "C:/Users/Alex/.juicer/lib/jslint/bin/jslint-1.0.js" "c:/t/j/s
cripts.js" (Errno::ENOENT)

does not clearly explains which file is missing.

AlexSkrypnyk commented 12 years ago

Found a reason for this problem: needed to add path to Java executable to PATH variable.