Psych can't parse simple key: value pair, Ruby, Yaml

315 views Asked by At

Running in to some parsing problems with ruby 1.9.2-p290 and rails 3.1.3.

My YAML file looks like this:

api_key: 12345

The other YAML files parse fine, like the database.yml and locale files. It's just this one. Any ideas as to why?

1

There are 1 answers

0
phoet On

there must be an error somwhere else, cause the line that you are showing is parsable by psych and syck engines:

YAML::ENGINE.yamler = 'psych'
YAML.load("api_key: 12345") # => {"api_key"=>12345}
YAML::ENGINE.yamler = 'syck'
YAML.load("api_key: 12345") # => {"api_key"=>12345}