If you don't want to use JRuby, consider using the 'trusted-sandbox' gem. It runs Ruby code within a fully controlled Docker container. You can disable network, set disk quotas, limit execution time, balance CPU with other running containers, set memory limits, etc. And the overhead is quite low.
If you don't want to use JRuby, consider using the 'trusted-sandbox' gem. It runs Ruby code within a fully controlled Docker container. You can disable network, set disk quotas, limit execution time, balance CPU with other running containers, set memory limits, etc. And the overhead is quite low.
You can find it here:
https://github.com/vaharoni/trusted-sandbox
Disclosure: this is a gem I built.