That's a bit of an overstatement, chances are there was a miscommunication and the person interviewing you did not know that you had been told there would be a know ruby questions. Seriously, its just an interview, they're not going to go out of their way to accomodate your every request, just roll with it. Since you were able to debug the ruby code, its sounds like you could have gotten the job if it wasn't for your attitude. IMO the right attitude is more important than raw technical skill, you might pass the "Can he code in ruby?" part of the interview, but fail the "Can he handle things not going his way?" part.
I recently had an interview for a developer job where I was asked lots of devops questions, even though it wasn't a devops-heavy role and I don't have much devops experience listed on my CV. I wasn't able to answer many of the questions but I drew on what little knowledge I did have to try and come up with answers. In the end I got the job because the interviewer said he appreciated how I tried to reason out answers to his questions even without much knowledge in the area. If I would have gotten all annoyed and started acting like I was being lied to and cheated then I doubt I would have gotten the job.