-
-
Save JamesZoft/2935767 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.3-p125 :008 > replacements = [ "hello", "test" ] => ["hello", "test"] | |
1.9.3-p125 :009 > new_str = replacements.reduce(){|str, (old, new)| str.gsub old, new} | |
TypeError: can't convert nil into String | |
from (irb):9:in `gsub' | |
from (irb):9:in `block in irb_binding' | |
from (irb):9:in `each' | |
from (irb):9:in `reduce' | |
from (irb):9 | |
from ~/.rvm/rubies/ruby-1.9.3-p125/bin/irb:16:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment