spree / deface

Rails plugin that allows you to customize ERB views in a Rails application without editing the underlying view.
MIT License
519 stars 128 forks source link

Encoding::UndefinedConversionError - "\xC2" from ASCII-8BIT to UTF-8: #136

Open sanchojaf opened 9 years ago

sanchojaf commented 9 years ago

Hi, I have the error when I do rails s

Encoding::UndefinedConversionError - "\xC2" from ASCII-8BIT to UTF-8:

when I am trying use deface for override rails_admin.

rake deface:precompile work fine.

my_override.rb test

Deface::Override.new(:virtual_path => "rails_admin/main/index", :name => "example-1", :replace => "li.dropdown", :text => "

  • New Post
  • ")

    https://gist.github.com/sanchojaf/bff0712fdadac408518f

    gem 'rails_admin','0.6.5' gem 'deface', '~> 1.0.0'

    the line that is trying to compile is 94: in

    https://github.com/sferik/rails_admin/blob/01d2bd884a3b536ea3dac41202b4f23f69ed9cb6/app/views/rails_admin/main/index.html.haml

    = "#list td.#{property.css_class} { max-width: #{property.column_width}px; }"

    Complete Gemfile source 'https://rubygems.org' ruby '2.1.2' gem 'rails', '4.1.4' gem 'sass-rails', '~> 4.0.3' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.0.0' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 2.0' gem 'sdoc', '~> 0.4.0', group: :doc gem 'spring', group: :development gem 'bootstrap-sass' gem 'devise','3.3.0' gem 'wicked' gem 'rails_admin','0.6.5' gem 'deface', '~> 1.0.0' gem 'ffaker' gem 'chartkick' gem 'therubyracer' gem 'haml' gem 'bootstrap3-datetimepicker-rails', '~> 3.1.3' gem 'awesome_nested_set' gem 'acts_as_list'

    group :development do gem 'better_errors' gem 'binding_of_caller', :platforms=>[:mri_21] gem 'quiet_assets' gem 'rails_layout' gem 'sqlite3' end group :production do gem 'thin' gem 'rails_12factor' gem 'pg' end

    Em-AK commented 9 years ago

    I have the same problem. Did you find a workaround ?

    adarsh commented 8 years ago

    Maybe try calling .force_encoding('UTF-8') on the string in question to coerce it.