This is because when the child process starts (the child process, which is your Ruby script in this case), the parent process (shell, system, etc.) may wait for completion.
As soon as he finishes, he can tell the parent process what the status of its execution is. Zero usually means that the execution completed successfully and completed without any errors.
If, for example, you run the shell script from bash and it calls Process.exit(0) , you can check if this succeeded using the $? variable $? :
$ ./my_ruby.script
kamituel
source share