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
.
SET JAVA_TOOL_OPTIONS= "-Dfile.encoding=UTF8"
worked for me too – Adelleadelpho