Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dir.exists? removed in Ruby 3.2 #636

Open
ScotterC opened this issue Jun 22, 2023 · 4 comments
Open

Dir.exists? removed in Ruby 3.2 #636

ScotterC opened this issue Jun 22, 2023 · 4 comments

Comments

@ScotterC
Copy link

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
Copy link

alexis commented Dec 9, 2023

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).

@translunar
Copy link
Member

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

@kojix2
Copy link
Member

kojix2 commented Dec 13, 2023

Use numo-narray.
https://github.com/ruby-numo/numo-narray

@barracuda156
Copy link

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

yk097 added a commit to yk097/nmatrix that referenced this issue Apr 10, 2024
Dir.exists? was removed in Ruby 3.2.(https://docs.ruby-lang.org/ja/3.0/method/Dir/s/exists=3f.html)
Changed to use Dir.exist?

Related Issues
SciRuby#636
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants