Fix errors on Rubinius and JRuby

These implementations have slightly different APIs for getting your
temp directory path.