1

运行 Rubocop 时,配置文件夹下的所有 yml 文件都会出现此错误。

例子:

config/database.yml:1:8: E: unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
default: &default
       ^
config/database.yml:2:10: E: unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
  adapter: postgresql
         ^
config/database.yml:3:11: E: unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
  encoding: unicode
          ^
config/database.yml:4:7: E: unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
  pool: 5
      ^

这是我的 database.yml 文件:

default: &default
  adapter: postgresql
  encoding: unicode
  pool: 5

development:
  <<: *default
  database: otimicar_development

test:
  <<: *default
  database: otimicar_test

这是什么意思?其他文件,如 secrets.yml 也产生相同类型的错误......

4

0 回答 0