10

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.

buruzaemon
  • 3,847
  • 1
  • 23
  • 44
  • Faced same thing with Jruby1.7, Rails 3.2.13 under Windows but without error or exception, just garpish text instead of Arabic .. running `SET JAVA_TOOL_OPTIONS= "-Dfile.encoding=UTF8"` worked for me too – Nimir May 11 '13 at 07:10
  • Happens to be a bug http://jira.codehaus.org/browse/JRUBY-7142; fixed since 1.7.5 – ted Aug 20 '13 at 09:01
  • @ted "fixed since 1.7.5"? It still appears that the latest release to date is 1.7.4... – buruzaemon Aug 20 '13 at 12:11
  • 1.7.5 is available at https://github.com/jruby/jruby, from sources – ted Aug 20 '13 at 14:22

1 Answers1

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
digitalextremist
  • 5,952
  • 3
  • 43
  • 62