Does anyone know why this yaml is parsed and read correctly by my app
development:
autocreate_indexes: false
allow_dynamic_fields: true
include_root_in_json: false
parameterize_keys: true
persist_in_safe_mode: false
raise_not_found_error: true
reconnect_time: 3
uri: mongodb://app:app@flame.mongohq.com:27076/app1
But this yaml is not
defaults: &defaults
autocreate_indexes: false
allow_dynamic_fields: true
include_root_in_json: false
parameterize_keys: true
persist_in_safe_mode: false
raise_not_found_error: true
reconnect_time: 3
development:
<<: *defaults
uri: mongodb://app:app@flame.mongohq.com:27076/app1
I had this issue a number of times in the past and would remove the shortcut syntax as a work around, but this time I’m working with a large app and it uses this syntax all over the place so I can’t easily convert it.
I never get a yaml parsing error, I just get various errors later in the call stack when values the app was depending on are not found.
My Environment:
ubuntu 11.04
python 2.7.1+
ruby 1.9.2-p180 under rvm
Let me know if there is anything else you would need to figure this out.
UPDATE
When I remove the shorthand syntax on this file, I get to the next error:
psych.rb:148:in `parse': couldn't parse YAML at line 7 column 19 (Psych::SyntaxError)
The solution was to add the following to my boot.rb