Railsコントローラーに次のコードがあります。
@main_mastertest = $connection.execute("SELECT * FROM builds;")
@l2_tmp_mastertest = Array.new
@l2_tmp_mastertest = @main_mastertest.map {|y|[y[0]]}
@l2_mastertest = Array.new
@l2_mastertest = @l2_tmp_mastertest.inject(Hash.new(0)) { |hash,element|
hash[element] +=1
hash }
@l2_mastertest = @l2_mastertest.sort_by { |x, _| x }.reverse
その後、私は私の見解でこのようなことをしようとします:
<% @l2_mastertest.each_with_index do |row1, index1| %>
<% @l2_mastertest.each_with_index do |row2, index2| %>
<% if row2[0][ /(\d+\.\d+)/ ].to_s == row1[0].to_s %> # LINE X
..................
<% end %>
<% end %>
<% end %>
しかし、X行目に次のエラーが表示されます:正規表現を整数に変換できません