Read more

Fix error "invalid byte sequence in US-ASCII" in .js.erb files

Henning Koch
February 22, 2013Software engineer at makandra GmbH

This error can happen in Ruby 1.9.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

To fix it, add the following line to the top of your .js.erb file:

<%# @encoding: UTF-8 %>
Posted by Henning Koch to makandra dev (2013-02-22 14:55)