Write a file oin ruby on rails By Administrator on 12:12 AM in log_path = '/home/project/logs' system("mkdir #{log_path}") if !File.directory?(log_path) log_content = "test content" File.open("#{log_path}/log_#{Time.now.to_i}.txt", 'a') { |file| file.write "#{log_content}" } Tweet