Ruby splits text into matrix creating a hash of counts of column 2
Sorry, but I didn't get your question on the shadowing part... Anyway, if you want to shorten it (and try to use something similar to each_with_object), you can do it this way, as a oneliner :)

pp data.each_line.with_object(Hash.new(0)) {|row,solution| solution[row.split(" ")[1]]+=1}


Except for the indirect handling with the double square brackets, I think that it is quite readable :)

Explanation (slightly changed by introducing an "index" temp variable for the sake of clarity)

pp data
 .each_line                                  #cycling line by line
 .with_object(Hash.new(0)) { |row,solution|  #using a Hash as accumulator, later called solution
     index=row.split(" ")[1]                 #setting the temp variable as the second column
     solution[index]+=1                      #increase the relevant counter in accumulator
 }