Executing ruby script from php script

<?php echo "my first php script"; $cmd = "ruby test.rb"; system($cmd); ?>

this code is not giving any output