Key value error in "Iterating over the Hash" (7/8)

error: “It looks like you aren’t printing each key-value pair to the console correctly. Make sure to put a space between each key and value!”


puts "Gimme a statement: "
text = gets.chomp
words = text.split(" ")
frequencies =

words.each do |x|
frequencies[x] += 1

frequencies = frequencies.sort_by {|word, count| count}

frequencies.each do |word, frequency|
   puts word + " " + frequency.to_s

Your code worked for me on the first try on this exercise. Try resetting the code. I gave two inputs - one a t e r the other a t t e r - both worked.

Didn’t work for me after resetting the code.

Can you paste a screenshot - in which your code, the console and the error you get are clearly visible? Thanks!

Didn’t work for me either. I’ve been trying to do that exercise for a long time now.