This is the correct answer below, but I'm not understanding why it is ok to type "puts word" in the last line, whereas it's not acceptable to type "puts x" since it is defined in almost the exact same way
puts "Text please "
text = gets.chomp
words = text.split(" ")
frequencies = Hash.new{0}
words.each { |word| frequencies[word] += 1}
frequencies = frequencies.sort_by { |x, y| y }
frequencies.reverse!
frequencies.each do |word, frequency|
puts word + " " + frequency.to_s
end