How does the pattern match operator work on arrays?  Does it basically compare them as though they were sets?  Because I think that's what you  want to do here (since the order may not be defined and doesn't matter), but I played around with the =~ operator in irb for a few seconds and it doesn't seem to be doing what I would expect based on my interpretation of your intent from this line of code.