Cannot get past Iterating Over an Array


I keep getting the message "it looks like you haven't added any key-value pairs to the frequencies hash."

I have been cruising along pretty well so far until this exercise and I CANNOT get past it. I've tried restructuing the code to mirror some of the others in the Q&A section just to see if it would allow for me to get past even though they looked exactly like my code, but am still getting the same message. Can anybody point out what it is I am failing to do as it seems that I have the right code in place relative to what everybody else is suggesting.... Help much appreciated

puts "text here"
text = gets.chomp
words = text.split (" ")
frequencies =
words.each { |word| frequencies[word] += 1 }


I just tried your code and it passed as expected. There are no errors.


Haha thanks. I don't know what the deal is, I feel like I am taking crazy pills. I've been stuck in this spot for an entire day and it still won't let me get past this exercise using the exact code I pasted in my initial post. Getting pretty frustrated...


Sounds rather odd. Have you tried,

page refresh

another browser



Yeah, I've tried both. At a bit of a loss at the moment. Thanks for taking the time to respond though, I really appreciate it.


There is nothing wrong with the above, but have you tried with no space after split? That is really just tossing something out there as this has me surprised. We've never seen this before.


Do you enter any string when "text here" shows in console?


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