bundle-fu icon indicating copy to clipboard operation
bundle-fu copied to clipboard

Obscure exception if last line of js file is a comment

Open cgriego opened this issue 15 years ago • 5 comments

If the last line of a JavaScript file is a comment, bundle_fu fails to generate the cache file and throws an obscure exception.

Exception message: comparison of Fixnum with String failed

cgriego avatar Oct 22 '09 16:10 cgriego

This issue is 1year old, but anyway I will post a comment about it. I was having the same problem some minutes ago, and I noticed this happens because of a minor incompatibility with Ruby 1.9.x in Bundle-fu's own JSMinimizer code. An easy workaround would be installing Packr (gem install packr), as bundle-fu will detect this package as installed and use Packr's compression code.

imkira avatar Nov 06 '10 17:11 imkira

I encountered this error with Ruby 1.8

cgriego avatar Nov 06 '10 19:11 cgriego

Ohhh.... that is not what I expected. Do you still have the full trace of the exception?

imkira avatar Nov 07 '10 04:11 imkira

i'm facing the same issue .. with ruby 1.8.7 and rails 2.2.2

here's the trace vendor/plugins/bundle-fu/lib/bundle_fu/js_minimizer.rb:79:in <=' vendor/plugins/bundle-fu/lib/bundle_fu/js_minimizer.rb:79:inmynext' vendor/plugins/bundle-fu/lib/bundle_fu/js_minimizer.rb:128:in action' vendor/plugins/bundle-fu/lib/bundle_fu/js_minimizer.rb:178:injsmin' vendor/plugins/bundle-fu/lib/bundle_fu/js_minimizer.rb:212:in minimize_content' vendor/plugins/bundle-fu/lib/bundle_fu.rb:33:inbundle_js_files' vendor/plugins/bundle-fu/lib/bundle_fu.rb:21:in bundle_files' vendor/plugins/bundle-fu/lib/bundle_fu.rb:11:ineach' vendor/plugins/bundle-fu/lib/bundle_fu.rb:11:in bundle_files' vendor/plugins/bundle-fu/lib/bundle_fu.rb:28:inbundle_js_files' vendor/plugins/bundle-fu/lib/bundle_fu.rb:118:in send' vendor/plugins/bundle-fu/lib/bundle_fu.rb:118:inbundle' vendor/plugins/bundle-fu/lib/bundle_fu.rb:100:in each' vendor/plugins/bundle-fu/lib/bundle_fu.rb:100:inbundle' app/views/layouts/partial_templates/_common_head_section.rhtml:45

hassanrehman avatar Dec 20 '11 08:12 hassanrehman

Thanks @imkira ! installing packr helped. Glad that you commented about it! saved me for sure some hours :) :+1:

hsyn avatar Jan 15 '15 13:01 hsyn