当我启动服务器时,我会得到以下错误:
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>不过,yaml文件在第2列第3栏中似乎是正常的:
fr:
Electronics_Circuits_Simulator_Realistic_Interface: "Simulateur de circuits electroniques. Interface reelle."有什么想法吗?
发布于 2017-06-27 11:11:25
这个错误常常是误导性的,并且指出了错误的路线。
在整个YML文件中寻找额外的空格,并尝试用"“替换所有封闭的单引号,它应该可以工作!
一个可能的原因是:
default: &default
a: 1
production: *default
b: 2代替:
default: &default
a: 1
production:
<<: *default
b: 2发布于 2020-01-05 21:26:44

如果您正在处理许多项目,请确保您在网站部分的连字符-是在线的,请看下面的图片,我有绿线。
发布于 2018-12-18 00:01:50
检查YML文件中的任何额外空白。另外,如果您像我一样,您可能会忘记删除YML模板中的{}。
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: valuehttps://stackoverflow.com/questions/44372522
复制相似问题