Prepared the error detection in a Ruby script