fixlr/codemirror-rails

assets:precompile fails on version 3.12

aptx4869 opened this issue · 6 comments

when I update the gem to gem 'codemirror-rails', '3.12',and then run
rake assets:precompile
it fails with error invalid byte sequence in UTF-8

but it works when I downgrade it back to version 3.02

Same happened here. Some javascript file change in 3.12 likely contains a symbol like ñ and that is causing sprokets to bonk out... Haven't figured out which file yet.

@stereoscott @aptx4869 I haven't been able to reproduce the problem in my apps. What version of Ruby are you running on?

I'm running ruby 2.0. the top of my gemfile looks like:

source "https://rubygems.org"
ruby "2.0.0"

gem "codemirror-rails", "~> 3.12"

When I open up vendor/assets/javascripts/codemirror/codemirror.js in my editor, I can see the file encoding is undefined, but saving the file as UTF-8 didn't help. There is something about this specific file that is giving sprockets problems. Still trying to figure it out...

rake aborted!
invalid byte sequence in UTF-8

Also, this seems to be an issue with codemirror.js downloaded directly from that project, and not just this rails gem.
There are probably some strange characters buried in the file that are causing a sprockets error.

All that is required is including this line in the application.js file:

//= require codemirror

I've been running this to trigger the error:

RAILS_ENV=production bundle exec rake assets:precompile --trace

More updates: I believe this is related to a different gem, turbo sprockets. See here: ndbroadbent/turbo-sprockets-rails3#64 (comment)

You can probably close this issue as it isn't an issue with this gem specifically. Cheers.

For reference, the resolution by stereoscott on the other issue: ndbroadbent/turbo-sprockets-rails3#64 (comment)