SciRuby/nmatrix

Dir.exists? removed in Ruby 3.2

ScotterC opened this issue · 4 comments

Extconf uses Dir.exists? which was removed in Ruby 3.2 (ruby-lang issue)

Dir.mkdir("data") unless Dir.exists?("data")
Dir.mkdir("util") unless Dir.exists?("util")
Dir.mkdir("storage") unless Dir.exists?("storage")
Dir.chdir("storage") do
Dir.mkdir("yale") unless Dir.exists?("yale")
Dir.mkdir("list") unless Dir.exists?("list")
Dir.mkdir("dense") unless Dir.exists?("dense")
end

To those running into this problem here's a monkey patch gem file_exists which is really just this alias_method

alexis commented

And it's possible to install it by adding it to a Gemfile, with RUBYOPT='-rfile_exists' bundle. (Though N[] syntax didn't work for me in ruby 3.2).

I don't think anyone is maintaining this library anymore. I encourage you to fork it if you'd like to!

Got the same error; it should just be patched to use exist? instead.