sunspot
sunspot copied to clipboard
NoMethodError on Ruby 3.2 for `File.exists?`
Ruby 3.2 removed the deprecated File.exists? and now Sunspot raises the following error on Ruby 3.2:
NoMethodError: undefined method `exists?' for File:Class
#1016 fixes this by replacing File.exists? with File.exist?.
I would love to see that PR merged. 🙇
Thanks!
Same here:
NoMethodError: undefined method exists?' for File:Class /Users/snip/.gems/gems/sunspot_solr-2.6.0/lib/sunspot/solr/server.rb:174:in install_solr_home'
/Users/snip/.gems/gems/sunspot_solr-2.6.0/lib/sunspot/solr/server.rb:40:in bootstrap' /Users/snip/.gems/gems/sunspot_solr-2.6.0/lib/sunspot/solr/server.rb:55:in start'
/Users/snip/.gems/gems/sunspot_solr-2.6.0/lib/sunspot/solr/tasks.rb:10:in block (3 levels) in <top (required)>' /Users/snip/.rbenv/versions/3.2.2/bin/bundle:25:in load'
/Users/snip/.rbenv/versions/3.2.2/bin/bundle:25:in `
We should probably release a new version of sunspot that integrates these changes as anyone downloading from Ruby Gems will have their app break on 3.2.0 https://rubygems.org/gems/sunspot_rails
The fix is merged in https://github.com/sunspot/sunspot/pull/1034
maybe @serggl could release a new Version?
Same problem here. locally I make the change but it will block a production release. Is it possible for you to make a new version with the changes?
Anyone ?
Thanks
Here is what I did to get by. If you are using rails, I just put it in a file in the initializers directory:
class File def self.exists?(filename) File.exist?(filename) end end
Frank
On Oct 5, 2023, at 11:35 AM, Fred @.***> wrote:
Same problem here. locally I make the change but it will block a production release. Is it possible for you to make a new version with the changes?
Anyone ?
Thanks
— Reply to this email directly, view it on GitHub https://github.com/sunspot/sunspot/issues/1024#issuecomment-1749148922, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABEM2XY3CPECKCVOM3U2L3X53HU5AVCNFSM6AAAAAATZM3TI6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBZGE2DQOJSGI. You are receiving this because you commented.
Cool, it looks better. Thanks. It will be okay temporarily for this issue.
The automated tests of github action do not pass. I was trying to run Solr in the CI like I do locally before running the Rspec tests. (it works locally) but that's another question...
@p8 that should be fixed in the v2.7.0
https://my.diffend.io/gems/sunspot_solr/2.6.0/2.7.0
Thanks @rocket-turtle !