samedi 26 septembre 2015

Ruby code doesn't work

/Users/danielwheeler/Desktop/Screen Shot 2015-09-26 at 13.18.16.png

I'm trying to make a method that takes a number as an input an converts it into a string. Not sure what's wrong.

Error message from sublime is:

/Users/danielwheeler/Desktop/code/projects/learn_to_program/ch10-nothing-new/english_number.rb:30:in `block in english_number': no implicit conversion of nil into String (TypeError)
    from /Users/danielwheeler/Desktop/code/projects/learn_to_program/ch10-nothing-new/english_number.rb:23:in `each'
    from /Users/danielwheeler/Desktop/code/projects/learn_to_program/ch10-nothing-new/english_number.rb:23:in `each_with_index'
    from /Users/danielwheeler/Desktop/code/projects/learn_to_program/ch10-nothing-new/english_number.rb:23:in `english_number'
    from /Users/danielwheeler/Desktop/code/projects/learn_to_program/ch10-nothing-new/english_number.rb:44:in `<main>'
[Finished in 0.1s with exit code 1]

Aucun commentaire:

Enregistrer un commentaire