My answer is a little late, but I ran into this same issue. With newer versions of Ray (such as 2.49.x), you can do so by setting the environment path as follows.
Here, 'TEMP_DIR' is the string path to the directory where temporary files are desired to be stored.
os.environ['RAY_TMPDIR'] = TEMP_DIR