<Psych::SyntaxError: 解析块映射时没有找到预期的键

sim*_*imo 7 yaml ruby-on-rails-4

当我启动服务器时,出现此错误:

I18n::InvalidLocaleData
can not load translations from /Users/Apple/myapp-website-freelance/config/locales/fr.yml: #<Psych::SyntaxError: (/Users/Apple/myapp-website-freelance/config/locales/fr.yml): did not find expected key while parsing a block mapping at line 2 column 3>
Run Code Online (Sandbox Code Playgroud)

虽然,yaml 文件在第 2 行第 3 列看起来很正常:

fr:
  Electronics_Circuits_Simulator_Realistic_Interface: "Simulateur de circuits electroniques. Interface reelle."
Run Code Online (Sandbox Code Playgroud)

任何的想法?

小智 15

此错误通常具有误导性并指出错误的行

在整个 YML 文件中查找额外的空格并尝试用“”替换所有封闭的单引号,它应该可以工作!