Skip to content

Instantly share code, notes, and snippets.

@bmaland
Created May 9, 2009 08:50
Show Gist options
  • Select an option

  • Save bmaland/109188 to your computer and use it in GitHub Desktop.

Select an option

Save bmaland/109188 to your computer and use it in GitHub Desktop.
# In Ruby 1.8
irb(main):008:0> "" + Errno::ENOENT.new
=> "No such file or directory"
irb(main):009:0> "" + Errno::ENOENT.new.to_s
=> "No such file or directory"
# In Ruby 1.9
irb(main):002:0> "" + Errno::ENOENT.new
TypeError: can't convert Errno::ENOENT into String
irb(main):003:0> "" + Errno::ENOENT.new.to_s
=> "No such file or directory"
# So, adding to_s is a good idea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment