Link to home
Start Free TrialLog in
Avatar of Tech_20
Tech_20

asked on

ruby undefined method error

I get the following error below with the attached ruby script and text file. Please note you will need to include the text file in the command line after entering the ruby file name. I tried referring to the variable 'mystery_word' in the script as an array but get the same error. Please help. Thanks.

'hangman.rb:47:in `<main>': undefined method `each' for "<mystery word>":String (NoMethodError)'
ruby_hangman.txt
wordsHangman.txt
ASKER CERTIFIED SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial