sstephenson / ruby-yui-compressor

A Ruby interface to YUI Compressor for minifying JavaScript and CSS assets.
217 stars 57 forks source link

popen4 can return nil status #21

Closed gregolsen closed 11 years ago

gregolsen commented 13 years ago

According to popen4 source code comments:

On windows executing a non existent command does not raise an error (as in unix) so on unix we return nil instead of a status object

It means that when java is not installed on unix 84 line in compressor.rb will throw "undefined method `exitstatus' for nil:NilClass (tested on Ubuntu with no java installed). That's why I've added validation for status presence.

marcbowes commented 13 years ago

+1 to getting this merged in. Under Linux, this manifests when Java is not installed, resulting in a NoMethodError - very confusing when running remotely, e.g. under Rails+Capistrano using rake assets:precompile.

shingara commented 12 years ago

I have this issue and can be usefull to know there are no java install instead of a YuiCompressor exception

SamSaffron commented 12 years ago

this took a while to track down .. a fix will be appreciated

stormsilver commented 11 years ago

:+1: for merging this in. Failing for me when Java is not installed.

robconery commented 11 years ago

+1 for the merge...

stevecrozz commented 11 years ago

This issue should be resolved now that I've taken care of: better error messaging: https://github.com/sstephenson/ruby-yui-compressor/pull/20 and replace Popen4 with tempfiles: https://github.com/sstephenson/ruby-yui-compressor/pull/14