How to check that a Ruby file is empty? August 14, 2023 by Tarik You could use the zero? method: File.zero?("test.rb")