I'm by no means a ruby expert, but my first suspicion is that you're using an assignment operator (=) instead of an equality operator (==). A quick google search for "ruby irb conditional" appears to prove this.
And you probably got the down vote because you did not include compilation errors in your question. If my guess is wrong, I can't even help try to interpret the error message, because you didn't provide it.
UPDATE: based on the first comment to the answer, I believe my first suspicion to be wrong - a misinterpretation of the intent of the line of code. But, then, this is what happens when error messages are not availble.
UPDATE2: first comment not there... maybe it was deleted or maybe I started typing in the wrong place...