下面是一个哈希:
hash = {
:home => {:team_name => "Brooklyn Nets", :colors => ['black','white'],
:players => {
{ player_name: "Alan Anderson",
number: '0',
shoe: '16',
points: 22,
rebounds: 12,
assists: 12 ,
steals:3 ,
blocks:1,
slam_dunks:1 }
}
},
:away => [:team_name, :colors, :players]
}
谁能告诉我为什么我不断收到此错误?
syntax error, unexpected '\n', expecting =>
它说这正在发生slam_dunks
。
hash = {
home => {:team_name => "Brooklyn Nets", :colors => ['black','white'],
:players => {
player_name: "Alan Anderson",
number: '0',
shoe: '16',
points: 22,
rebounds: 12,
assists: 12 ,
steals:3 ,
blocks:1,
slam_dunks:1
}
},
:away => [:team_name, :colors, :players]
}
删除了玩家钥匙内的多余括号,这是导致该错误的原因。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句