ndbroadbent / turbo-sprockets-rails3

Speeds up your Rails 3 assets:precompile by only recompiling changed files, and only compiling once to generate all assets
MIT License
975 stars 78 forks source link

invalid byte sequence in UTF-8 #35

Open mrrooijen opened 11 years ago

mrrooijen commented 11 years ago

Hi there,

I came across your gem and figured I'd give it a go. Unfortunately whenever I add your gem along with your buildpack, it always results in the following error:

-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       invalid byte sequence in UTF-8
       Tasks: TOP => assets:precompile:all
       (See full trace by running task with --trace)
       Precompiling assets failed, enabling runtime asset compilation
       Injecting rails31_enable_runtime_asset_compilation
       Please see this article for troubleshooting help:
       http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting

It seems to have finished compiling the assets though, and it finishes the deployment and the assets work on the application itself. However, I think there might be some turbo-sprockets-related post-processing that might be failing.

When I remove the gem and the buildpack, the application's assets compile just fine. When I re-add the gem and buildpack, the same error occurs again.

Do you have any idea why this is happening? The applicatie is very Javascript heavy so I think it'd benefit greatly from your tool.

Thanks!

jrunning commented 11 years ago

I'm seeing the same issue when deploying with Capistrano (Rails 3.2.8):

  * 2012-12-04 12:21:53 executing `deploy:assets:precompile'
  * executing "cd /#####/releases/20121204182054 && bundle exec rake RAILS_ENV=user_test RAILS_GROUPS=assets assets:precompile"
    servers: ["<HOSTNAME>"]
    [<HOSTNAME>] executing command
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require': iconv will be deprecated in the future, use String#encode instead.
*** [err :: <HOSTNAME>] rake aborted!
*** [err :: <HOSTNAME>] invalid byte sequence in UTF-8
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/turbo-sprockets-rails3-0.2.12/lib/sprockets/static_non_digest_generator.rb:46:in `gsub!'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/turbo-sprockets-rails3-0.2.12/lib/sprockets/static_non_digest_generator.rb:46:in `block in generate'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:212:in `block in each_logical_path'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:200:in `block (2 levels) in each_file'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:190:in `each'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:190:in `each_entry'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:198:in `block in each_file'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:197:in `each'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:197:in `each_file'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:210:in `each_logical_path'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/turbo-sprockets-rails3-0.2.12/lib/sprockets/static_non_digest_generator.rb:29:in `generate'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/turbo-sprockets-rails3-0.2.12/lib/turbo-sprockets/tasks/assets.rake:92:in `internal_precompile'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/turbo-sprockets-rails3-0.2.12/lib/turbo-sprockets/tasks/assets.rake:112:in `block (3 levels) in <top (required)>'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/turbo-sprockets-rails3-0.2.12/lib/turbo-sprockets/tasks/assets.rake:34:in `invoke_or_reboot_rake_task'
*** [err :: <HOSTNAME>] /#####/shared/bundle/ruby/1.9.1/gems/turbo-sprockets-rails3-0.2.12/lib/turbo-sprockets/tasks/assets.rake:49:in `block (2 levels) in <top (required)>'
*** [err :: <HOSTNAME>] Tasks: TOP => assets:precompile:all
*** [err :: <HOSTNAME>] (See full trace by running task with --trace)
    command finished in 38345ms
*** [deploy:update_code] rolling back

(I believe the iconv deprecation warning is unrelated, I believe. It's from the rubyjedi-soap4r gem.)

Here's my assets group:

group :assets do
  gem 'sass-rails',     '~> 3.2.3'
  gem 'bootstrap-sass', '~> 2.1.0.0'
  gem 'handlebars_assets'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'

  gem 'jquery-ui-rails'
end

I hope that's helpful.

ansel1 commented 11 years ago

Also just started seeing this after updating to rails 3.2.10 and the 0.3.0 line of this gem. Also hit the same error with MRI.

*** [err :: localhost] org/jruby/RubyString.java:3048:in `gsub!'
*** [err :: localhost] /opt/safemonk/shared/bundle/jruby/1.9/gems/turbo-sprockets-rails3-0.3.4/lib/sprockets/static_non_digest_generator.rb:46:in `generate'
*** [err :: localhost] /opt/safemonk/shared/bundle/jruby/1.9/gems/sprockets-2.2.2/lib/sprockets/base.rb:219:in `each_logical_path'
*** [err :: localhost] /opt/safemonk/shared/bundle/jruby/1.9/gems/sprockets-2.2.2/lib/sprockets/base.rb:206:in `each_file'
*** [err :: localhost] org/jruby/RubyArray.java:1612:in `each'
*** [err :: localhost] /opt/safemonk/shared/bundle/jruby/1.9/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each_entry'
*** [err :: localhost] /opt/safemonk/shared/bundle/jruby/1.9/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `each_file'
*** [err :: localhost] org/jruby/RubyArray.java:1612:in `each'
*** [err :: localhost] /opt/safemonk/shared/bundle/jruby/1.9/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
*** [err :: localhost] /opt/safemonk/shared/bundle/jruby/1.9/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
*** [err :: localhost] /opt/safemonk/shared/bundle/jruby/1.9/gems/turbo-sprockets-rails3-0.3.4/lib/sprockets/static_non_digest_generator.rb:29:in `generate'
*** [err :: localhost] /opt/safemonk/shared/bundle/jruby/1.9/gems/turbo-sprockets-rails3-0.3.4/lib/turbo-sprockets/tasks/assets.rake:94:in `internal_precompile'
*** [err :: localhost] /opt/safemonk/shared/bundle/jruby/1.9/gems/turbo-sprockets-rails3-0.3.4/lib/turbo-sprockets/tasks/assets.rake:114:in `(root)'
*** [err :: localhost] org/jruby/RubyProc.java:249:in `call'
*** [err :: localhost] org/jruby/RubyArray.java:1612:in `each'
*** [err :: localhost] /opt/safemonk/shared/bundle/jruby/1.9/gems/turbo-sprockets-rails3-0.3.4/lib/turbo-sprockets/tasks/assets.rake:34:in `invoke_or_reboot_rake_task'
*** [err :: localhost] /opt/safemonk/shared/bundle/jruby/1.9/gems/turbo-sprockets-rails3-0.3.4/lib/turbo-sprockets/tasks/assets.rake:49:in `(root)'
*** [err :: localhost] org/jruby/RubyProc.java:249:in `call'
*** [err :: localhost] org/jruby/RubyArray.java:1612:in `each'
*** [err :: localhost] org/jruby/RubyArray.java:1612:in `each'
*** [err :: localhost] org/jruby/RubyKernel.java:1046:in `load'

Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (3.2.10)
      actionpack (= 3.2.10)
      mail (~> 2.4.4)
    actionpack (3.2.10)
      activemodel (= 3.2.10)
      activesupport (= 3.2.10)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.4)
      rack (~> 1.4.0)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.2.1)
    active_attr (0.7.0)
      activemodel (>= 3.0.2, < 4.1)
      activesupport (>= 3.0.2, < 4.1)
    activemodel (3.2.10)
      activesupport (= 3.2.10)
      builder (~> 3.0.0)
    activerecord (3.2.10)
      activemodel (= 3.2.10)
      activesupport (= 3.2.10)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activerecord-jdbc-adapter (1.2.2.1)
    activerecord-jdbcpostgresql-adapter (1.2.2.1)
      activerecord-jdbc-adapter (~> 1.2.2.1)
      jdbc-postgres (>= 9.0, < 9.2)
    activeresource (3.2.10)
      activemodel (= 3.2.10)
      activesupport (= 3.2.10)
    activesupport (3.2.10)
      i18n (~> 0.6)
      multi_json (~> 1.0)
    addressable (2.3.2)
    ansi (1.4.3)
    arel (3.0.2)
    audited (3.0.0)
    audited-activerecord (3.0.0)
      activerecord (~> 3.0)
      audited (= 3.0.0)
    blankslate (2.1.2.4)
    bouncy-castle-java (1.5.0146.1)
    builder (3.0.4)
    cancan (1.6.8)
    cancan_strong_parameters (0.2.3)
      activesupport
      cancan
      strong_parameters
    capistrano (2.13.5)
      highline
      net-scp (>= 1.0.0)
      net-sftp (>= 2.0.0)
      net-ssh (>= 2.0.14)
      net-ssh-gateway (>= 1.1.0)
    capybara (1.1.4)
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      selenium-webdriver (~> 2.0)
      xpath (~> 0.1.4)
    capybara_minitest_spec (0.2.2)
      capybara
      minitest (>= 2.0)
    childprocess (0.3.6)
      ffi (~> 1.0, >= 1.0.6)
    client_side_validations (3.2.1)
    client_side_validations-simple_form (2.0.1)
      client_side_validations (~> 3.2.0)
      simple_form (~> 2.0.3)
    coderay (1.0.8)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.4.0)
    daemons (1.1.9)
    database_cleaner (0.9.1)
    dogapi (1.5.0)
      json (>= 1.5.1)
    edn (1.0.0)
      parslet (~> 1.4.0)
    erubis (2.7.0)
    eventmachine (1.0.0)
    eventmachine (1.0.0-java)
    excon (0.15.5)
    execjs (1.4.0)
      multi_json (~> 1.0)
    faraday (0.8.4)
      multipart-post (~> 1.1)
    faye-websocket (0.4.6)
      eventmachine (>= 0.12.0)
    faye-websocket (0.4.6-java)
      eventmachine (>= 0.12.0)
    ffi (1.2.0)
    ffi (1.2.0-java)
    ffi-locale (1.0.1)
      ffi (>= 1.0.9)
    ffi-ncurses (0.4.0)
      ffi (>= 1.0.9)
      ffi-locale (>= 1.0.0)
    friendly_id (4.0.9)
    guard (1.6.1)
      listen (>= 0.6.0)
      lumberjack (>= 1.0.2)
      pry (>= 0.9.10)
      thor (>= 0.14.6)
    guard-jasmine (1.11.0)
      childprocess
      guard (>= 1.1.0)
      multi_json
      thor
    guard-minitest (0.5.0)
      guard (>= 0.4)
    haml (3.1.7)
    hashie (1.2.0)
    highline (1.6.15)
    hike (1.2.1)
    http_parser.rb (0.5.3)
    http_parser.rb (0.5.3-java)
    i18n (0.6.1)
    jasminerice (0.0.10)
      coffee-rails
      haml
    jdbc-postgres (9.1.901)
    journey (1.0.4)
    jquery-rails (2.1.4)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    jruby-openssl (0.7.4)
      bouncy-castle-java
    json (1.7.6)
    json (1.7.6-java)
    json_expressions (0.8.1)
    launchy (2.0.3)
    launchy (2.0.3-java)
      spoon (~> 0.0.1)
    libv8 (3.11.8.4)
    libwebsocket (0.1.7.1)
      addressable
      websocket
    listen (0.7.0)
    lumberjack (1.0.2)
    mail (2.4.4)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mandrill-api (1.0.12)
      excon (~> 0.15.4)
      json (~> 1.7.4)
    method_source (0.8.1)
    mime-types (1.19)
    miniskirt (1.2.1)
      activesupport
    minitest (3.5.0)
    minitest-metadata (0.3.0)
      minitest (>= 2.12)
    minitest-reporters (0.14.1)
      ansi
      builder
      minitest (>= 2.12, < 5.0)
      powerbar
    minitest-spec-rails (3.0.6)
      minitest
      rails (~> 3.0)
    multi_json (1.5.0)
    multipart-post (1.1.5)
    net-scp (1.0.4)
      net-ssh (>= 1.99.1)
    net-sftp (2.0.5)
      net-ssh (>= 2.0.9)
    net-ssh (2.6.2)
    net-ssh-gateway (1.1.0)
      net-ssh (>= 1.99.1)
    newrelic_rpm (3.5.4.34)
    nokogiri (1.5.6)
    nokogiri (1.5.6-java)
    parslet (1.4.0)
      blankslate (~> 2.0)
    pg (0.14.1)
    poltergeist (1.0.2)
      capybara (~> 1.1)
      childprocess (~> 0.3)
      faye-websocket (~> 0.4, >= 0.4.4)
      http_parser.rb (~> 0.5.3)
      multi_json (~> 1.0)
    polyamorous (0.5.0)
      activerecord (~> 3.0)
    polyglot (0.3.3)
    powerbar (1.0.11)
      ansi (~> 1.4.0)
      hashie (>= 1.1.0)
    pry (0.9.10)
      coderay (~> 1.0.5)
      method_source (~> 0.8)
      slop (~> 3.3.1)
    pry (0.9.10-java)
      coderay (~> 1.0.5)
      method_source (~> 0.8)
      slop (~> 3.3.1)
      spoon (~> 0.0)
    rabl (0.7.9)
      activesupport (>= 2.3.14)
      multi_json (~> 1.0)
    rack (1.4.1)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-contrib (1.1.0)
      rack (>= 0.9.1)
    rack-ssl (1.3.2)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (3.2.10)
      actionmailer (= 3.2.10)
      actionpack (= 3.2.10)
      activerecord (= 3.2.10)
      activeresource (= 3.2.10)
      activesupport (= 3.2.10)
      bundler (~> 1.0)
      railties (= 3.2.10)
    railties (3.2.10)
      actionpack (= 3.2.10)
      activesupport (= 3.2.10)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    rake (10.0.3)
    rb-fsevent (0.9.3)
    rb-inotify (0.8.8)
      ffi (>= 0.5.0)
    rdoc (3.12)
      json (~> 1.4)
    ref (1.0.2)
    rubyzip (0.9.9)
    sass (3.2.4)
    sass-rails (3.2.5)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    selenium-webdriver (2.27.2)
      childprocess (>= 0.2.5)
      libwebsocket (~> 0.1.3)
      multi_json (~> 1.0)
      rubyzip
    sentry-raven (0.3.1)
      faraday (~> 0.8.0.rc2)
      hashie
      multi_json (~> 1.0)
      uuidtools
    simple_form (2.0.4)
      actionpack (~> 3.0)
      activemodel (~> 3.0)
    slop (3.3.3)
    spoon (0.0.1)
    sprockets (2.2.2)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    squeel (1.0.14)
      activerecord (~> 3.0)
      activesupport (~> 3.0)
      polyamorous (~> 0.5.0)
    strong_parameters (0.1.6)
      actionpack (~> 3.0)
      activemodel (~> 3.0)
      railties (~> 3.0)
    terminal-notifier-guard (1.5.3)
    therubyracer (0.11.0)
      ref
    therubyrhino (2.0.2)
      therubyrhino_jar (>= 1.7.3)
    therubyrhino_jar (1.7.4)
    thin (1.5.0)
      daemons (>= 1.0.9)
      eventmachine (>= 0.12.6)
      rack (>= 1.0.0)
    thor (0.16.0)
    tilt (1.3.3)
    torquebox (2.2.0)
      thor (>= 0.14.6)
      torquebox-cache (= 2.2.0)
      torquebox-configure (= 2.2.0)
      torquebox-core (= 2.2.0)
      torquebox-messaging (= 2.2.0)
      torquebox-naming (= 2.2.0)
      torquebox-rake-support (= 2.2.0)
      torquebox-security (= 2.2.0)
      torquebox-stomp (= 2.2.0)
      torquebox-transactions (= 2.2.0)
      torquebox-web (= 2.2.0)
    torquebox-cache (2.2.0-java)
      torquebox-core (= 2.2.0)
      torquebox-transactions (= 2.2.0)
    torquebox-capistrano-support (2.2.0)
    torquebox-configure (2.2.0-java)
      blankslate (= 2.1.2.4)
    torquebox-core (2.2.0-java)
    torquebox-messaging (2.2.0-java)
      edn (= 1.0.0)
      torquebox-core (= 2.2.0)
      torquebox-transactions (= 2.2.0)
    torquebox-naming (2.2.0-java)
    torquebox-rake-support (2.2.0)
      rake (>= 0.8.7)
    torquebox-security (2.2.0-java)
      torquebox-core (= 2.2.0)
    torquebox-server (2.2.0-java)
      torquebox (= 2.2.0)
    torquebox-stomp (2.2.0)
      torquebox-core (= 2.2.0)
      torquebox-messaging (= 2.2.0)
    torquebox-transactions (2.2.0)
      torquebox-core (= 2.2.0)
    torquebox-web (2.2.0-java)
    treetop (1.4.12)
      polyglot
      polyglot (>= 0.3.1)
    turbo-sprockets-rails3 (0.3.4)
      railties (> 3.2.8, < 4.0.0)
      sprockets (>= 2.0.0)
    tzinfo (0.3.35)
    uglifier (1.3.0)
      execjs (>= 0.3.0)
      multi_json (~> 1.0, >= 1.0.2)
    uuidtools (2.1.3)
    websocket (1.0.6)
    xpath (0.1.4)
      nokogiri (~> 1.3)

PLATFORMS
  java
  ruby

DEPENDENCIES
  active_attr
  activerecord-jdbcpostgresql-adapter (~> 1.2.2.1)
  audited-activerecord (~> 3.0.0.rc2)
  cancan
  cancan_strong_parameters
  capistrano
  capybara
  capybara_minitest_spec
  client_side_validations
  client_side_validations-simple_form
  coffee-rails (~> 3.2.1)
  database_cleaner
  dogapi
  ffi-ncurses
  friendly_id (~> 4.0.1)
  guard-jasmine
  guard-minitest
  jasminerice
  jquery-rails
  jruby-openssl (= 0.7.4)
  json_expressions
  launchy
  libv8 (~> 3.11.8)
  mail
  mandrill-api
  miniskirt
  minitest (~> 3.0)
  minitest-metadata
  minitest-reporters
  minitest-spec-rails
  newrelic_rpm
  pg
  poltergeist
  rabl
  rack-contrib
  rails (= 3.2.10)
  rake (= 10.0.3)
  rb-fsevent (~> 0.9.1)
  rb-inotify
  sass-rails (~> 3.2.3)
  sentry-raven
  simple_form
  squeel
  strong_parameters
  terminal-notifier-guard
  therubyracer
  therubyrhino
  thin
  torquebox
  torquebox-capistrano-support
  torquebox-server
  turbo-sprockets-rails3 (~> 0.3.0)
  uglifier (>= 1.0.3)
ngan commented 11 years ago

I'm getting this error as well...Rails 3.2.11.

~/.rvm/rubies/ruby-1.9.3-p327/bin/ruby bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
invalid byte sequence in UTF-8
gems/turbo-sprockets-rails3-0.3.6/lib/sprockets/static_non_digest_generator.rb:46:in `gsub!'
gems/turbo-sprockets-rails3-0.3.6/lib/sprockets/static_non_digest_generator.rb:46:in `block in generate'
gems/sprockets-2.2.2/lib/sprockets/base.rb:219:in `block in each_logical_path'
gems/sprockets-2.2.2/lib/sprockets/base.rb:206:in `block (2 levels) in each_file'
gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each'
gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each_entry'
gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
gems/turbo-sprockets-rails3-0.3.6/lib/sprockets/static_non_digest_generator.rb:29:in `generate'
gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/tasks/assets.rake:93:in `internal_precompile'
gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/tasks/assets.rake:113:in `block (3 levels) in <top (required)>'
ngan commented 11 years ago

A little more info...I found that this error is popping up while processing the Modernizr javascript asset--which I've included into my app with:

gem "modernizr", "~> 2.6.2"
ngan commented 11 years ago

It appears that where the error being raised isn't the real problem. The file that it was trying to process was: public/assets/modernizr/emoji-1fdffd9da5acbc887bfa5226a3ba6a43.js which has some mangled UTF-8 characters. The original file provided by the gem is read and worked with just fine. So I'm thinking that whatever is writing the file public/assets/modernizr/emoji-1fdffd9da5acbc887bfa5226a3ba6a43.js is messing it up.

Original file:

//= require modernizr
// Requires a Modernizr build with `canvastext` included
// http://www.modernizr.com/download/#-canvas-canvastext
Modernizr.addTest('emoji', function() {
  if (!Modernizr.canvastext) return false;
  var node = document.createElement('canvas'),
      ctx = node.getContext('2d');
  ctx.textBaseline = 'top';
  ctx.font = '32px Arial';
  ctx.fillText('\ud83d\ude03', 0, 0); // "smiling face with open mouth" emoji
  return ctx.getImageData(16, 16, 1, 1).data[0] !== 0;
});

Compiled file (cat to console):

// ...
t.fillText("??????",0,0),t.getImageData(16,16,1,1).data[0]!==0});
gingerlime commented 11 years ago

any updates on this? we'd love to use this gem, and so far it looks great, but this kind of potential issues makes us a little scared

gingerlime commented 11 years ago

We were doing fine so far, but suddenly started seeing a similar error when deploying (however it complains about US-ASCII instead of UTF-8. Would be great if anyone has some workarounds / solutions / ideas on this...

/usr/local/bin/ruby-1.9.3-p327/bin/ruby /var/local/kenhub/kenhub.d/51/vendor/bundle/ruby/1.9.1/bin/rake assets:precompile:all RAILS_ENV=staging RAILS_GROUPS=assets
rake aborted!
invalid byte sequence in US-ASCII
(in /var/local/kenhub/kenhub.d/51/vendor/bundle/ruby/1.9.1/gems/i18n-js-2.1.2/vendor/assets/javascripts/i18n/translations.js.erb)
...
gingerlime commented 11 years ago

Sorry, false alarm. This is (most likely) not the same issue. I think I found a fix for this particular problem: https://github.com/fnando/i18n-js/pull/139

steverandy commented 11 years ago

https://github.com/ndbroadbent/turbo-sprockets-rails3/pull/64

jakswa commented 11 years ago

+1 for having this issue as well. steverandy's modification fixes things (#64), but it seems like it's not a good approach to the issue? any other ideas on this? It seems really hard to pinpoint what causes this error if you are adding it to a project for the first time (and there are many asset files that could be the culprit...).

stereoscott commented 11 years ago

Check out our findings over in this comment: https://github.com/ndbroadbent/turbo-sprockets-rails3/pull/64#issuecomment-18654913. In my case I was getting this error when turbo-sprockets was reading a file that had been run through the default sprockets--> uglifier chain. Uglifier was converting ascii versions of the unicode characters in my source js into UTF-8, which when read back into turbo-sprockets will read as an invalid byte-sequence. Setting uglifier to ascii_only in your app's production.rb seems to fix the issue.

elskwid commented 11 years ago

Following on from @ngan's comments I too had some problems with Modernizr.

GBH commented 10 years ago

Maybe this is relevant? https://github.com/intridea/multi_json/issues/136

rap1ds commented 10 years ago

+1 Same issue here. This is preventing me from using this gem :(