Charles Mills <cmills / freeshell.org> wrote: > This is a bug with the String#<=>. It has been discussed on Ruby talk > before, but at some point something similar to the following is > happening: > irb(main):001:0> 'a' <=> 1 > => false > irb(main):002:0> ('a' <=> 1) > 0 > NoMethodError: undefined method `>' for false:FalseClass > from (irb):2 > > 'a' <=> 1 should return nil in this situation. Thank you for this detailed explanation. I worked around the problem by catching NoMethodError in my code that uses Range#include? -Levin