ruby on rails - YAML File has a syntax error, but it looks like it has the same format as another one that is working? -
i have 2 yaml files similar formats, 1 running , other not running when run integration tests on rails app.
here first yaml file doesn't work:
prince_edward_island: name: 'prince edward island' country: 'canada'
nova_scotia: name: 'nova scotia' country: 'canada'
newfoundland: name: 'newfoundland' country: 'canada' new_brunswick: name: 'new brunswick' country: 'canada' quebec: name: 'quebec' country: 'canada' manitoba: name: 'manitoba' country: 'canada' alberta: name: 'alberta' country: 'canada' ontario: name: 'ontario' country: 'canada' british_columbia: 'canada' name: 'british columbia' country: 'canada' saskatchewan: 'canada' name: 'saskatchewan' country: 'canada'
here second yaml file work:
student_advisor_message: body: 'this message' subject: 'subject!' user: student_advisor manager_message: body: 'this message' subject: 'subject!' user: manager read_manager_message: body: 'this message' subject: 'subject!' user: manager agent_manager_message: body: 'this message' subject: 'subject!' user: agent_manager message_for_jack: body: 'this message' subject: 'subject!' user: manager message_for_jack_sent: body: 'this sent message' subject: 'sent subject!' user: manager message_for_jack_trash: body: 'this trashed message' subject: 'trash subject!' user: manager
the error is:
error: while parsing block mapping in "<unicode string>", line 1, column 1: prince_edward_island: ^ expected <block end>, found '<block mapping start>' in "<unicode string>", line 34, column 3: name: 'british columbia'
can explain difference missing between two? both use spaces, not tabs.
there several errors:
for both use tabs, not spaces.
tabs not allowed indentation characters in yaml.
country: 'canada' nova_scotia:
here, give both scalar ('canada'
) , mapping (starting nova_scotia:
) value key country
. there may 1 value key. either have remove scalar 'canada'
or move mapping contains elsewhere.
british_columbia: 'canada' name: 'british columbia' country: 'canada' saskatchewan: 'canada' name: 'saskatchewan' country: 'canada'
here, make same error again twice.
Comments
Post a Comment