Apparently I have not set up the Hash properly. I can't see what is wrong with my code (however as a total beginner that does not surprise me!). Can you help please?
puts "write some text" text = gets.chomp words = text.split("") frequencies = Hash.new(0) words.each do |words| frequencies[words]+=1 frequencies = frequencies.sort_by do |frequencies, count| end frequencies.reverse! end