You should know that this is not really protecting your code. At some point, the code will have to be executed by Ruby's VM (let's assume you're on 1.9.x). The VM itself, unless modified, will only be able to understand the instructions in their unencrypted form.
What this means is that before the encrypted code can be executed, it will have to be transformed back into its original form. And someone badly craving to read your source code could do so by debugging the Ruby process and waiting for that decryption to happen.
Even if it's just the byte code instructions that you will get from this, it's possible to reconstruct quite readable source code from byte code interpretation, here is an example for Java, but similar things are possible for Ruby, too.
Code obfuscation might be more what you are looking for, but it is also a very risky option for Ruby code: it might break sophisticated meta programming features.
I've never been a friend of DRM measures, so it might be that I am quite opinionated here... but are you really, really convinced you will need such features?