As I mentioned in my comments, I believe it is better to provide the service than the program itself. Not least because obfuscating the code does not prevent reverse engineering processes from being carried out and make it impossible to access the code.
That being said, if you even opt for this solution, it is possible to obfuscate the code by "compiling" it with the Ruby Encoder, for example.
Another alternative would be to make the code in another language (like C, for example) and just use the Ruby application as a "wrapper" of that code. This can still bring other advantages, such as gain in performance, for example.
Why don’t you just provide the service (server)? Then it has no access to the source.
– Felipe Avelar
The problem is that there are some specific customers who cannot depend on the internet for the system to work, that is, I need to operate offline. I need to have a physical server in the company.
– Bmucelini
All right, and that server could not be yours, with maintenance contract, etc?
– Felipe Avelar
We have a similar question, only for Java. I think it’s worth checking out: http://answall.com/questions/7257/howto protect o-c%C3%B3digo-source
– Oralista de Sistemas