In VIM, at the moment when I need to comment out a section of Ruby code:
After visually selecting, in block mode, the text you want to comment out, hit I (that is a capital i), type # and finally hit the escape key. It's basically the same procedure you are using currently, but using insert instead of replace.