Sorting the Hash. I seem to have checked everything. What's wrong with my code?


This code gives me this error message:
Oops, try again. It looks like you haven't set the frequencies hash correctly. Check the first exercise if you need help!

What did I do wrong?

puts "Input string please:"
text = gets.chomp

words = text.split(" ")

frequencies =
frequencies = words.each {|word| frequencies[word] += 1}
frequencies = frequencies.sort_by {|k, v| v }  


should just be,

words.each {|word| frequencies[word] += 1}