我有:
STEAK_HASH = {
'Chargrilled Sirloin Steak (Rare)': 1,
'Chargrilled Sirloin Steak (Medium Rare)': 2,
'Chargrilled Sirloin Steak (Medium)': 3,
'Chargrilled Sirloin Steak (Medium Well)': 4,
'Chargrilled Sirloin Steak (Well Done)': 5
}
哪个是有效的红宝石。当我运行rubocop时,我得到:
app/models/venue_category.rb:12:52: E: unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
'Chargrilled Sirloin Steak (Rare)': 1,
这显然是针对ruby 2.1。在我的rubocop.yml文件中,我有:
TargetRubyVersion: 2.3.1
所以我的两个选项..要么将它定位到我的ruby版本,要么只是禁用错误警告?