librato-rails icon indicating copy to clipboard operation
librato-rails copied to clipboard

File.exists? is removed in Ruby 3.2

Open espen opened this issue 2 years ago • 4 comments

See https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/

espen avatar Jan 08 '23 14:01 espen

Fixes https://github.com/librato/librato-rails/issues/149

espen avatar Jan 08 '23 14:01 espen

Great @espen! Would love to get this merged, if this project is still active! =)

tmbv93 avatar Apr 10 '23 12:04 tmbv93

Hello @nextmat , @bdehamer , @chancefeick and @pat ,

Could anyone please take steps to merge this PR soon. Or could you please suggest any alternative solution (gem) for the changes in this PR?

Thank you ! Asiful Islam Sakib Software Engineer, WellDev

ai-sakib avatar Nov 09 '23 05:11 ai-sakib

Hello @nextmat , @bdehamer , @chancefeick and @pat ,

Could anyone please take steps to merge this PR soon. Or could you please suggest any alternative solution (gem) for the changes in this PR?

Thank you ! Asiful Islam Sakib Software Engineer, WellDev

You can monkey patch this pretty easily:

# Removed in Ruby 3.2 but needed for librato (even most recent version as of today).
# Using this monkeypatch seems to make sense (for now).
# 
# https://github.com/librato/librato-rails/pull/150
class File
  def self.exists?(filename)
    self.exist?(filename)
  end
end

Not ideal, but will let you move on to some other things for now :)

jipiboily avatar Nov 14 '23 18:11 jipiboily