burtlo / yard-cucumber

YARD extension that adds Cucumber Features, Tags, and Step Definitions
MIT License
128 stars 46 forks source link

incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError) #35

Open linuxonrails opened 12 years ago

linuxonrails commented 12 years ago

$ yardoc 'features/*/.rb' 'features/*/.feature'

/home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/helpers/html_syntax_highlight_helper.rb:32:in `block in html_syntax_highlight_ruby_ripper': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/helpers/html_syntax_highlight_helper.rb:24:in `each'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/helpers/html_syntax_highlight_helper.rb:24:in `html_syntax_highlight_ruby_ripper'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/helpers/html_syntax_highlight_helper.rb:13:in `html_syntax_highlight_ruby'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/helpers/html_helper.rb:161:in `html_syntax_highlight'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-cucumber-2.1.7/lib/templates/default/steptransformers/html/transformers.erb:35:in `block in _erb_cache_50'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-cucumber-2.1.7/lib/templates/default/steptransformers/html/transformers.erb:3:in `each'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-cucumber-2.1.7/lib/templates/default/steptransformers/html/transformers.erb:3:in `_erb_cache_50'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:267:in `erb'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-cucumber-2.1.7/lib/templates/default/steptransformers/html/setup.rb:29:in `stepdefinitions'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:343:in `render_section'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:239:in `block (2 levels) in run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:236:in `each'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:236:in `block in run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:374:in `add_options'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:235:in `run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:123:in `run'
burtlo commented 12 years ago

Thank you for posting this error. I will take a look to see if there are some issues.

linuxonrails commented 12 years ago

I am sorry. I have forgotten this info request!

ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]

cucumber 1.1.9 gherkin (2.10.0, 2.9.0, 2.7.7) yard 0.8.1 yard-cucumber (2.1.7)

I have updated the gem versions and it's working now!! Thanks!!

burtlo commented 12 years ago

I'm glad it's working @linuxonrails. Happy gardening!

linuxonrails commented 12 years ago

I'm sorry again.

Today i have found the problem.

It was in a step with multiline strings:

https://gist.github.com/2766963

# encoding: UTF-8

Given /^exists a lote$/ do
  user = Factory :user,
    Gastos_envio: "Aceptamos pago mediante tarjeta de crédito DIRECTAMENTE CON NOSOTROS,
Paypal (pagos superiores a 20 euros), por transferencia bancaria / ingreso en
cuenta, o en mano si se recoge el artículo en nuestra tienda. Envío por correo
CERTIFICADO (no realizamos envíos por correo ordinario), según tarifas vigentes
a España. No enviamos contrareembolso. Si en una semana no se ha recibido el pago
se anulará la venta y se notificará el impago"
end

I have fixed my code but it hasn't any errors.

$ yardoc features/step_definitions/lotes_steps.rb
/home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/helpers/html_syntax_highlight_helper.rb:30:in `block in html_syntax_highlight_ruby_ripper': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/helpers/html_syntax_highlight_helper.rb:22:in `each'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/helpers/html_syntax_highlight_helper.rb:22:in `html_syntax_highlight_ruby_ripper'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/helpers/html_syntax_highlight_helper.rb:11:in `html_syntax_highlight_ruby'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/helpers/html_helper.rb:161:in `html_syntax_highlight'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-cucumber-2.1.7/lib/templates/default/steptransformers/html/transformers.erb:35:in `block in _erb_cache_30'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-cucumber-2.1.7/lib/templates/default/steptransformers/html/transformers.erb:3:in `each'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-cucumber-2.1.7/lib/templates/default/steptransformers/html/transformers.erb:3:in `_erb_cache_30'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:267:in `erb'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-cucumber-2.1.7/lib/templates/default/steptransformers/html/setup.rb:29:in `stepdefinitions'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:343:in `render_section'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:239:in `block (2 levels) in run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:236:in `each'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:236:in `block in run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:374:in `add_options'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:235:in `run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:123:in `run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:348:in `render_section'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:239:in `block (2 levels) in run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:236:in `each'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:236:in `block in run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:374:in `add_options'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:235:in `run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:257:in `block in yieldall'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:388:in `with_section'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:257:in `yieldall'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/templates/default/layout/html/layout.erb:18:in `_erb_cache_7'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:267:in `erb'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:345:in `render_section'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:239:in `block (2 levels) in run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:236:in `each'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:236:in `block in run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:374:in `add_options'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:235:in `run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:123:in `run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/templates/default/fulldoc/html/setup.rb:34:in `block in serialize'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/engine.rb:116:in `with_serializer'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/templates/default/fulldoc/html/setup.rb:33:in `serialize'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-cucumber-2.1.7/lib/templates/default/fulldoc/html/setup.rb:38:in `init'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:173:in `initialize'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:118:in `new'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/template.rb:123:in `run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/templates/engine.rb:104:in `generate'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/cli/yardoc.rb:354:in `run_generate'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/cli/yardoc.rb:258:in `run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/lib/yard/cli/command.rb:13:in `run'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/gems/yard-0.8.1/bin/yardoc:12:in `<top (required)>'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/bin/yardoc:19:in `load'
    from /home/davidm/.rvm/gems/ruby-1.9.2-p180@mobile/bin/yardoc:19:in `<main>'
burtlo commented 12 years ago

Sorry that it doesn't work. Thank you for the awesome data to try and fix this.

UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)

I assume that the issue is either in my add-on with how it processes the data or inherit in YARD. I'll take a look at it.