我正在使用仪表板来显示一些数据。我其中一项工作的部分代码使用了地图!红宝石中的功能:
vars = arr.map! { |element| element.gsub(/.{3}$/, '' )}
当我尝试使用 dashing start 运行仪表板时,出现以下错误:
scheduler caught exception:
undefined method map! for #<Hash: 0x......>
如果我将代码作为 ruby 程序单独运行,我会得到正确的结果。