Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding::UndefinedConversionError ("\xD7" from ASCII-8BIT to UTF-8): #62

Open
justame opened this issue Dec 9, 2013 · 4 comments
Open

Comments

@justame
Copy link

justame commented Dec 9, 2013

hello,

after adding "spree-product-assembly" gem to the gemfile when i get to a one of the pages i get this error: "Encoding::UndefinedConversionError ("\xD7" from ASCII-8BIT to UTF-8)"

just to let you know , i'm using Hebrew characters in the website.

here is the stack trace:

Started GET "/products/ytsvb-myvkhd-llqtrh-br" for 10.0.2.2 at 2013-12-09 19:23:27 +0200
Processing by Spree::ProductsController#show as HTML
  Parameters: {"id"=>"ytsvb-myvkhd-llqtrh-br"}
  Spree::Preference Load (0.5ms)  SELECT "spree_preferences".* FROM "spree_preferences" WHERE "spree_preferences"."key" = 'spree/frontend_configuration/locale' ORDER BY "spree_preferences"."id" ASC LIMIT 1
   (0.2ms)  BEGIN
  SQL (0.7ms)  UPDATE "spree_preferences" SET "value_type" = $1, "updated_at" = $2, "value" = $3 WHERE "spree_preferences"."id" = 7  [["value_type", :string], ["updated_at", Mon, 09 Dec 2013 17:23:27 UTC +00:00], ["value", "--- he\n...\n"]]
   (1.5ms)  COMMIT
  Spree::Preference Load (1.1ms)  SELECT "spree_preferences".* FROM "spree_preferences" WHERE "spree_preferences"."key" = 'spree/backend_configuration/locale' ORDER BY "spree_preferences"."id" ASC LIMIT 1
   (0.3ms)  BEGIN
  SQL (0.4ms)  UPDATE "spree_preferences" SET "value_type" = $1, "updated_at" = $2, "value" = $3 WHERE "spree_preferences"."id" = 8  [["value_type", :string], ["updated_at", Mon, 09 Dec 2013 17:23:27 UTC +00:00], ["value", "--- en\n...\n"]]
   (0.9ms)  COMMIT
  Spree::Order Load (0.3ms)  SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."id" = $1 LIMIT 1  [["id", 9]]
  Spree::Taxonomy Load (0.4ms)  SELECT "spree_taxonomies".* FROM "spree_taxonomies" ORDER BY spree_taxonomies.position LIMIT 1
  Spree::Taxon Load (0.4ms)  SELECT "spree_taxons".* FROM "spree_taxons" WHERE "spree_taxons"."taxonomy_id" = $1 AND "spree_taxons"."parent_id" IS NULL ORDER BY "lft" LIMIT 1  [["taxonomy_id", 18]]
  Spree::Taxon Load (0.3ms)  SELECT "spree_taxons".* FROM "spree_taxons" WHERE "spree_taxons"."parent_id" = $1 ORDER BY "lft"  [["parent_id", 62]]
  Spree::User Load (0.5ms)  SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."id" = 1 ORDER BY "spree_users"."id" ASC LIMIT 1
  Spree::Order Load (0.4ms)  SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."user_id" = $1 AND "spree_orders"."completed_at" IS NULL AND "spree_orders"."created_by_id" = 1 ORDER BY created_at DESC LIMIT 1  [["user_id", 1]]
  Spree::Order Load (0.4ms)  SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."id" = 9 AND "spree_orders"."currency" = 'ILS' LIMIT 1
  Spree::Adjustment Load (0.4ms)  SELECT "spree_adjustments".* FROM "spree_adjustments" WHERE "spree_adjustments"."adjustable_type" = 'Spree::Order' AND "spree_adjustments"."adjustable_id" IN (9) ORDER BY spree_adjustments.created_at ASC
   (0.5ms)  SELECT COUNT(*) FROM "spree_roles" INNER JOIN "spree_roles_users" ON "spree_roles"."id" = "spree_roles_users"."role_id" WHERE "spree_roles_users"."user_id" = $1 AND "spree_roles"."name" = 'admin'  [["user_id", 1]]
  Spree::Product Load (0.4ms)  SELECT "spree_products".* FROM "spree_products" WHERE ("spree_products".deleted_at IS NULL) AND "spree_products"."permalink" = 'ytsvb-myvkhd-llqtrh-br' LIMIT 1
  Spree::ProductProperty Load (0.2ms)  SELECT "spree_product_properties".* FROM "spree_product_properties" WHERE "spree_product_properties"."product_id" = $1 ORDER BY spree_product_properties.position  [["product_id", 57]]
  Spree::Property Load (0.3ms)  SELECT "spree_properties".* FROM "spree_properties" WHERE "spree_properties"."id" = $1 ORDER BY "spree_properties"."id" ASC LIMIT 1  [["id", 1]]
  Spree::PropertyGroup Load (0.2ms)  SELECT "spree_property_groups".* FROM "spree_property_groups" WHERE "spree_property_groups"."id" = $1 ORDER BY "spree_property_groups"."id" ASC LIMIT 1  [["id", 1]]
  Spree::Property Load (0.3ms)  SELECT "spree_properties".* FROM "spree_properties" WHERE "spree_properties"."id" = $1 ORDER BY "spree_properties"."id" ASC LIMIT 1  [["id", 3]]
  Spree::PropertyGroup Load (0.4ms)  SELECT "spree_property_groups".* FROM "spree_property_groups" WHERE "spree_property_groups"."id" = $1 ORDER BY "spree_property_groups"."id" ASC LIMIT 1  [["id", 3]]
  Spree::Property Load (0.4ms)  SELECT "spree_properties".* FROM "spree_properties" WHERE "spree_properties"."id" = $1 ORDER BY "spree_properties"."id" ASC LIMIT 1  [["id", 4]]
  Spree::PropertyGroup Load (0.3ms)  SELECT "spree_property_groups".* FROM "spree_property_groups" WHERE "spree_property_groups"."id" = $1 ORDER BY "spree_property_groups"."id" ASC LIMIT 1  [["id", 2]]
  Spree::Property Load (0.3ms)  SELECT "spree_properties".* FROM "spree_properties" WHERE "spree_properties"."id" = $1 ORDER BY "spree_properties"."id" ASC LIMIT 1  [["id", 2]]
  CACHE (0.0ms)  SELECT "spree_property_groups".* FROM "spree_property_groups" WHERE "spree_property_groups"."id" = $1 ORDER BY "spree_property_groups"."id" ASC LIMIT 1  [["id", 1]]
Deface: 2 overrides found for 'spree/products/show'
Completed 500 Internal Server Error in 54ms

Encoding::UndefinedConversionError ("\xD7" from ASCII-8BIT to UTF-8):
  haml (4.0.4) lib/haml/compiler.rb:42:in `encode'
  haml (4.0.4) lib/haml/compiler.rb:42:in `precompiled'
  haml (4.0.4) lib/haml/compiler.rb:47:in `precompiled_with_return_value'
  haml (4.0.4) lib/haml/engine.rb:129:in `render'
  deface (1.0.0) lib/deface/haml_converter.rb:102:in `result'
  deface (1.0.0) lib/deface/applicator.rb:17:in `apply'
  deface (1.0.0) lib/deface/action_view_extensions.rb:9:in `initialize'
  actionpack (4.0.2) lib/action_view/template/resolver.rb:195:in `new'
  actionpack (4.0.2) lib/action_view/template/resolver.rb:195:in `block in query'
  actionpack (4.0.2) lib/action_view/template/resolver.rb:191:in `map'
  actionpack (4.0.2) lib/action_view/template/resolver.rb:191:in `query'
  actionpack (4.0.2) lib/action_view/template/resolver.rb:177:in `find_templates'
  actionpack (4.0.2) lib/action_view/template/resolver.rb:115:in `block in find_all'
  actionpack (4.0.2) lib/action_view/template/resolver.rb:145:in `block in cached'
  actionpack (4.0.2) lib/action_view/template/resolver.rb:62:in `cache'
  actionpack (4.0.2) lib/action_view/template/resolver.rb:144:in `cached'
  actionpack (4.0.2) lib/action_view/template/resolver.rb:114:in `find_all'
  actionpack (4.0.2) lib/action_view/path_set.rb:53:in `block (2 levels) in find_all'
  actionpack (4.0.2) lib/action_view/path_set.rb:52:in `each'
  actionpack (4.0.2) lib/action_view/path_set.rb:52:in `block in find_all'
  actionpack (4.0.2) lib/action_view/path_set.rb:51:in `each'
  actionpack (4.0.2) lib/action_view/path_set.rb:51:in `find_all'
  actionpack (4.0.2) lib/action_view/path_set.rb:46:in `find'
  actionpack (4.0.2) lib/action_view/lookup_context.rb:122:in `find'
  actionpack (4.0.2) lib/action_view/renderer/abstract_renderer.rb:18:in `find_template'
  actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:35:in `determine_template'
  actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:8:in `render'
  actionpack (4.0.2) lib/action_view/renderer/renderer.rb:42:in `render_template'
  actionpack (4.0.2) lib/action_view/renderer/renderer.rb:23:in `render'
  actionpack (4.0.2) lib/abstract_controller/rendering.rb:127:in `_render_template'
  actionpack (4.0.2) lib/action_controller/metal/streaming.rb:219:in `_render_template'
  actionpack (4.0.2) lib/abstract_controller/rendering.rb:120:in `render_to_body'
  actionpack (4.0.2) lib/action_controller/metal/rendering.rb:33:in `render_to_body'
  actionpack (4.0.2) lib/action_controller/metal/renderers.rb:26:in `render_to_body'
  actionpack (4.0.2) lib/abstract_controller/rendering.rb:97:in `render'
  actionpack (4.0.2) lib/action_controller/metal/rendering.rb:16:in `render'
  actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
  activesupport (4.0.2) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
  /home/yaron/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
  activesupport (4.0.2) lib/active_support/core_ext/benchmark.rb:12:in `ms'
  actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
  actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
  activerecord (4.0.2) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
  actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:40:in `render'
  remotipart (1.2.1) lib/remotipart/render_overrides.rb:14:in `render_with_remotipart'
  actionpack (4.0.2) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
  actionpack (4.0.2) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
  actionpack (4.0.2) lib/abstract_controller/base.rb:189:in `process_action'
  actionpack (4.0.2) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.0.2) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (4.0.2) lib/active_support/callbacks.rb:483:in `_run__593263328__process_action__callbacks'
  activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
  actionpack (4.0.2) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (4.0.2) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
  activesupport (4.0.2) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.0.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.0.2) lib/active_support/notifications.rb:159:in `instrument'
  actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.0.2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
  activerecord (4.0.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.0.2) lib/abstract_controller/base.rb:136:in `process'
  actionpack (4.0.2) lib/abstract_controller/rendering.rb:44:in `process'
  actionpack (4.0.2) lib/action_controller/metal.rb:195:in `dispatch'
  actionpack (4.0.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.0.2) lib/action_controller/metal.rb:231:in `block in action'
  actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `call'
  actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
  actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:48:in `call'
  actionpack (4.0.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
  actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `each'
  actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `call'
  actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:680:in `call'
  railties (4.0.2) lib/rails/engine.rb:511:in `call'
  railties (4.0.2) lib/rails/railtie/configurable.rb:30:in `method_missing'
  actionpack (4.0.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
  actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `each'
  actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `call'
  actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:680:in `call'
  xray-rails (0.1.9) lib/xray/middleware.rb:37:in `call'
  rack-pjax (0.7.0) lib/rack/pjax.rb:12:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `catch'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  rack (1.5.2) lib/rack/etag.rb:23:in `call'
  rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
  rack (1.5.2) lib/rack/head.rb:11:in `call'
  remotipart (1.2.1) lib/remotipart/middleware.rb:27:in `call'
  actionpack (4.0.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.0.2) lib/action_dispatch/middleware/flash.rb:241:in `call'
  rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.0.2) lib/action_dispatch/middleware/cookies.rb:486:in `call'
  activerecord (4.0.2) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
  actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.0.2) lib/active_support/callbacks.rb:373:in `_run__983020954__call__callbacks'
  activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
  actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.0.2) lib/action_dispatch/middleware/reloader.rb:64:in `call'
  actionpack (4.0.2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
  actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
  activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
  activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
  railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
  quiet_assets (1.0.2) lib/quiet_assets.rb:18:in `call_with_quiet_assets'
  actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  actionpack (4.0.2) lib/action_dispatch/middleware/static.rb:64:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  railties (4.0.2) lib/rails/engine.rb:511:in `call'
  railties (4.0.2) lib/rails/application.rb:97:in `call'
  rack (1.5.2) lib/rack/content_length.rb:14:in `call'
  thin (1.6.1) lib/thin/connection.rb:82:in `block in pre_process'
  thin (1.6.1) lib/thin/connection.rb:80:in `catch'
  thin (1.6.1) lib/thin/connection.rb:80:in `pre_process'
  thin (1.6.1) lib/thin/connection.rb:55:in `process'
  thin (1.6.1) lib/thin/connection.rb:41:in `receive_data'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
  thin (1.6.1) lib/thin/backends/base.rb:73:in `start'
  thin (1.6.1) lib/thin/server.rb:162:in `start'
  rack (1.5.2) lib/rack/handler/thin.rb:16:in `run'
  rack (1.5.2) lib/rack/server.rb:264:in `start'
  railties (4.0.2) lib/rails/commands/server.rb:84:in `start'
  railties (4.0.2) lib/rails/commands.rb:76:in `block in <top (required)>'
  railties (4.0.2) lib/rails/commands.rb:71:in `tap'
  railties (4.0.2) lib/rails/commands.rb:71:in `<top (required)>'
  bin/rails:4:in `require'
  bin/rails:4:in `<main>'

and the gemfile :

source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '~> 4.0.0'

gem 'thin'
gem 'pg'
gem 'rails_12factor', group: :production
gem 'jquery-rails'
gem "seedbank", github: 'james2m/seedbank'
gem 'annotate'
gem 'haml-rails'
gem 'wasabi', :github => "gaaady/wasabi"
gem 'nori', :github => "gaaady/nori"
gem 'savon', :github => "gaaady/savon", :branch => 'version2'
gem 'spree', :github => 'spree/spree', branch: '2-1-stable'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', branch: '2-1-stable'
gem 'spree_related_products', :git => 'git://github.com/spree/spree_related_products.git', branch: '2-1-stable'
gem 'spree_banner', github: "justame/spree_banner"
gem 'spree_product_assembly', :git => 'git://github.com/spree/spree-product-assembly.git', branch: '2-1-stable'
gem 'sass-rails',   '~> 4.0.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'bootstrap-sass-rails-rtl'
gem 'compass-rails', "~> 2.0.alpha.0"
gem 'lodash-rails'
gem 'uglifier', '>= 1.0.3'
gem 'jquery-validation-rails'


gem 'rails_admin'
gem 'bootstrap-wysihtml5-rails'
gem 'redcarpet', '2.3.0'
gem 'fancybox2-rails', '~> 0.2.4'
gem 'gon'

group :development do
   gem 'jshint_on_rails'
   # gem 'jazz_hands'
   gem 'pry'
   gem 'pry-rails'
   gem 'pry-nav'
  gem "better_errors"
  gem "binding_of_caller"
  gem 'xray-rails'
  gem "quiet_assets", ">= 1.0.1"
  gem "letter_opener"
  # gem 'pry-doc'
  # gem 'pry-stack_explorer'
  # gem 'pry-exception_explorer'
end

group :production do
  gem 'rails_12factor'
end

i'm using Haml in the project overriding the frontpage files.
i found that after removing the deface files from the gem the problem solved.
the 2 deface files location is in "app/overrides/spree/products/show"

is there another way to fix that issue?

@radar
Copy link

radar commented Dec 10, 2013

Hi @justame, thank you for the information. Do you have a list of steps that we can follow to reproduce this issue within a brand new application?

Thanks!

@huoxito
Copy link

huoxito commented Dec 16, 2013

Haven't tried to run it with the store in Hebrew yet but theres a good chance this issue belongs to deface. You raised an interesting point also. I will check if we can disable the deface files in this extension by using some config. I think this should work https://github.com/spree/deface/#production--precompiling but looks like it will disable the defaces from every gem.

@gaaady
Copy link

gaaady commented May 22, 2014

This problem still exists in Spree 2.2

@misteral
Copy link

misteral commented Jun 4, 2014

HAML + Deface = not good working with non english chars. Convert haml to erb http://haml2erb.herokuapp.com/ - temporary decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants