Replace File.exists? method with File.exist?
File.exists? was deprecated in ruby 2.2, and removed in 3.2, see [1]. Currently Debian's bin:ruby points to ruby3.1, but ruby 3.3 is already packaged and the default will eventually change.
[1] https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/