class MyFile
  extend Gem::Deprecate

  def no_more
    close
  end
  deprecate :no_more, :close, 2015, 5

  def close
    # new logic here
  end
end

MyFile.new.no_more
# => NOTE: MyFile#no_more is deprecated; use close instead. It will be removed on or after 2015-05-01.
# => MyFile#no_more called from my_file.rb:16.

Source: Best practice to mark deprecated code in Ruby? - Answer on StackOverflow

Documentation here: Module: Gem::Deprecate (Ruby 3.0.2). Much better than just a comment.