Hello there. I am trying to recover a password of which I think I know the first letters, but where I can't remember the last ones, which were digits if I remember well.
I know I'm not exactly answering your question (sorry, I don't really know ruby either), but if you'd like to try
btcrecover (if someone with ruby experience doesn't respond), I can help you with that.
You'd basically need to download it (from the "download zip" button at the page linked above), and then take what's below and save it to a text file named "btcrecover-tokens-auto.txt" in the same directory as the Python script, and then follow the instructions under
Quick Start in the Tutorial.
#--pause --wallet /home/lapa/.electrum/wallets/default_wallet
guili%1,6d
Let me know if you have any questions...