henrycatalinismith / ppl

The command line address book
http://henry.catalinismith.com/ppl/
Other
300 stars 18 forks source link

Switch exists? to exist? for compatibility with Ruby 3.2.0 #92

Closed henrycatalinismith closed 3 months ago

henrycatalinismith commented 3 months ago

Installing rugged 1.1.0 fails on Ruby 3.2.0

Fetching gem metadata from https://rubygems.org/.......
Resolving dependencies...
Using vpim 13.11.11 (was 24.2.20)
Installing rugged 1.1.0 (was 1.7.2) with native extensions
iGem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/henrycatalinismith/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rugged-1.1.0/ext/rugged
/Users/henrycatalinismith/.rbenv/versions/3.2.2/bin/ruby extconf.rb
checking for gmake... yes
checking for cmake... yes
checking for pkg-config... yes
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/Users/henrycatalinismith/.rbenv/versions/3.2.2/bin/$(RUBY_BASE_NAME)
        --with-sha1dc
        --without-sha1dc
        --use-system-libraries
extconf.rb:101:in `block in <main>': undefined method `exists?' for Dir:Class (NoMethodError)

    Dir.mkdir("build") if !Dir.exists?("build")
                              ^^^^^^^^
Did you mean?  exist?
        from extconf.rb:100:in `chdir'
        from extconf.rb:100:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

Calls to exists? in the repo itself also need replacing.

Creating a PR as part of this fix to see if CI still works.