I want to create a temp file:
def create_file FileUtils.mkdir_p('/var/log/my_app') tmp_file = '/var/log/my_app/tmp_file' File.open(tmp_file, 'w') do |file| file.write 'test' end end Here I am sure that the /var/log/my_app path exists. But after I run this method, I can't find a file named tmp_file under that path. And there wasn't any error, too.