I'm not sure if there is a shortcut or not, but usually you can just type in the first portion, and rubymine will auto close it. You just have to hit a space after you do the opening. So doing:
<%' ' outputs=> <% /code %>
<%=' ' outputs=> <%= /code %>
And it does this for the rest of the openings.