0

I've been trying to troubleshoot this for a day; growing desperate!

rake assets:precompile fails with following encoding error when //= require jquery is included in manifest but works when it's commented out as so: // require jquery:

$ RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile --trace
. . .
Caught Encoding::CompatibilityError at '["ok","!function(e,t': incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string)
  (in /rails/myapp/releases/20130920030318/app/assets/javascripts/application.js)
/rails/myapp/shared/bundle/ruby/2.0.0/gems/json-1.8.0/lib/json/pure/parser.rb:242:in `rescue in parse_string'
/rails/myapp/shared/bundle/ruby/2.0.0/gems/json-1.8.0/lib/json/pure/parser.rb:213:in `parse_string'
/rails/myapp/shared/bundle/ruby/2.0.0/gems/json-1.8.0/lib/json/pure/parser.rb:257:in `parse_value'
. . . 

Failing application.js:

//= require jquery
//= require jquery_ujs
//= require hogan.js
//= require bootstrap
//= require twitter/typeahead
// require twitter/typeahead.min
//= require dataTables/jquery.dataTables
//= require dataTables/jquery.dataTables.bootstrap
//= require turbolinks
//= require_tree .

but change that first line and it works:

// require jquery
//= require jquery_ujs
. . . 

Gemfile

. . . 
gem 'jquery-rails'
. . .

Any ideas? How to troubleshoot or debug this?!?

Meltemi
  • 37,979
  • 50
  • 195
  • 293
  • Try something like http://stackoverflow.com/questions/7812479/rails-fb-connect-async-js-provokes-500-error – Ven Sep 20 '13 at 17:04
  • Ruby 2, Rails 4 and the same asset list; I don't have a problem. Did you do a `bundle exec RAILS_ENV=production rake assets:clean` and then recompile? – trh Sep 20 '13 at 17:34
  • `bundle exec rake assets:clean RAILS_ENV=production` didn't help :-( – Meltemi Sep 20 '13 at 18:31
  • @user1737909 - so, you mean try something like turning on and off my computer?!? – Meltemi Sep 20 '13 at 18:35
  • @trh - 'same asset list'. would you mind sharing your `datatables.js` or `datatables.js.coffee`? Maybe via a [gist](https://gist.github.com). I think my problem may be in there; it's the only reference to `e` in my application. – Meltemi Sep 20 '13 at 18:45

0 Answers0