Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


rc8: Obscure error message with invalid YAML in fixtures #2731

Quintus opened this Issue · 2 comments

2 participants


Hi there,

When putting invalid YAML into the files in test/fixtures, the errors are reported fine when using Syck as the YAML parser:

    ERROR should correctly determine languages (0.00s) 
          ActiveRecord::Fixture::FormatError: a YAML error occurred parsing some/path/here/test/fixtures/users.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Please have a look at
The exact error was:
  ArgumentError: syntax error on line 28, col -1: `  first_name: "Foo"

However, when Psych (the default) is in action, the error message looks like this:

    ERROR should correctly determine languages (0.03s) 
          Psych::SyntaxError: couldn't parse YAML at line 29 column 2
          /opt/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0.rc8/lib/active_record/fixtures.rb:719:in `parse_yaml_string'

The latter is not really informative as it doesn't give me any clue in which file I have misformatted YAML code. It shouldn't be too hard to capture the Psych::SyntaxError exception the same way Syck errors are cought and formatted?

ruby -v: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
OS: Arch Linux
rails -v: Rails 3.1.0.rc8



Duplicate of #2645

@tenderlove tenderlove was assigned

Fixed in e46c4f1

@tenderlove tenderlove closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.