Error: "can't convert String into Integer"


Hello everyone!

The console show this message: "can't convert String into Integer", but the code is exactly like in example...

words = text.split(" ")
frequencies =

words.each do |word|
frequencies = frequencies.sort_by { |k, v| v }
frequencies.each {|word, frequency| puts word+" "+frequency.to_s}


Please post a link to this exercise. Thank you.



Move this line up to just under,


so it closes the do block, before the sort block.


Thanks man :sweat_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.