这是一个问题:serenity-gem在ruby 1.8.7下完美运行,但在ruby 2.0.0p195下发生了一些事情。在使用相同的模板和 ruby 代码时,它给了我以下错误:
incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
/home/michael/.rvm/gems/ruby-2.0.0-p195/gems/serenity-odt-0.2.1/lib/serenity/generator.rb:5:in `render_odt'
/home/michael/.rvm/gems/ruby-2.0.0-p195/gems/serenity-odt-0.2.1/lib/serenity/odteruby.rb:17:in `eval'
/home/michael/.rvm/gems/ruby-2.0.0-p195/gems/serenity-odt-0.2.1/lib/serenity/odteruby.rb:17:in `evaluate'
/home/michael/.rvm/gems/ruby-2.0.0-p195/gems/serenity-odt-0.2.1/lib/serenity/template.rb:19:in `block (2 levels) in process'
/home/michael/.rvm/gems/ruby-2.0.0-p195/gems/serenity-odt-0.2.1/lib/serenity/template.rb:16:in `each'
/home/michael/.rvm/gems/ruby-2.0.0-p195/gems/serenity-odt-0.2.1/lib/serenity/template.rb:16:in `block in process'
/home/michael/.rvm/gems/ruby-2.0.0-p195/gems/rubyzip-0.9.9/lib/zip/zip_file.rb:90:in `open'
/home/michael/.rvm/gems/ruby-2.0.0-p195/gems/serenity-odt-0.2.1/lib/serenity/template.rb:15:in `process'
/home/michael/.rvm/gems/ruby-2.0.0-p195/gems/serenity-odt-0.2.1/lib/serenity/generator.rb:5:in `render_odt'
这个解决方案对我没有影响:github,stackoverflow。
我的环境:Ubuntu 12.04.2 LTS x86_64 3.2.0-49-generic,rvm 1.21.2。