Psych YAML problems

Caught Psych::SyntaxError: (xxxxxx.yaml): couldn’t parse YAML at line
column 8
c:/apps/ruby193/lib/ruby/1.9.1/psych.rb:154:in parse' c:/apps/ruby193/lib/ruby/1.9.1/psych.rb:154:inparse_stream’
c:/apps/ruby193/lib/ruby/1.9.1/psych.rb:125:in parse' c:/apps/ruby193/lib/ruby/1.9.1/psych.rb:112:inload’
c:/apps/ruby193/lib/ruby/1.9.1/psych.rb:229:in `load_file’

  • !ruby/object:Command
    cmd: :cmd_gc <–OFFENDING LINE
    help: runs garbage collection
    name: @gc

Similar previous objects are parsed correctly.
This is the last object in the file.
There are no tabs, contains only \n as linefeeds.

ruby 1.9.3p0 (2011-10-30) [i386-mingw32]

Works in rubies 1.8.[4,6,7] and 1.9.1.

On Feb 3, 2012, at 16:25 , Jon L. wrote:

  • !ruby/object:Command
    cmd: :cmd_gc <–OFFENDING LINE
    help: runs garbage collection
    name: @gc

I suspect it is @gc, not :cmd_gc:

% ruby19 -rpsych -ryaml -e ‘p YAML.dump(:cmd => :cmd_gc)’
“—\n:cmd: :cmd_gc\n”

% ruby19 -rpsych -ryaml -e ‘p YAML.dump(:cmd => “@gc”)’
“—\n:cmd: ! ‘@gc’\n”

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs