bind "mouse1" "+attack;_inven gems ruby 1"
Don't forget to go into your options after you're done mining to set it back to normal. Rebinding it to just "+attack" won't fix it. You have to go into your main menu options to fix that.
Let me know if that bind doesn't work.