Вопрос

In our JRuby/Rails project, we are using the i18n gem, and support Japanese as well as English. Our config/locales.ja.yml file is in UTF-8, without any BOM.

When running Rails 3.2.9 on JRuby 1.7.1, we now see the following error:

% jruby -S rake spec:models

 Psych::SyntaxError: (C:/Projects/foobar/trunk/config/locales/ja.yml): 
   expected <block end>, but found Scalar while parsing a block 
   mapping at line 7 column 33

   parse at org/jruby/ext/psych/PsychParser.java:213
   ... 

This error for YAML parsing the ja.yml file is now happening on both our Windows XP and Linux development environments, and only seems to go away when we explicitly set the following system parameter for the JVM:

-Dfile.encoding=utf-8

Could anyone tell me why this is happening on JRuby 1.7.1?
I didn't see this in 1.6.8 or 1.7.0.

Это было полезно?

Решение

Over a year old now, but here is the answer:

http://jruby.org/2012/12/03/jruby-1-7-1.html

In that release, this happened:

  • Psych YAML engine updated to latest
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top