pry/pry · error · NotImplementedError
Cannot yet patch #{code_object} objects!
Error message
Cannot yet patch #{code_object} objects! What it means
Error "Cannot yet patch #{code_object} objects!" thrown in pry/pry.
Source
Thrown at lib/pry/commands/edit.rb:103
!file_based_exception? &&
(opts.present?(:patch) ||
previously_patched?(code_object) ||
pry_method?(code_object))
end
def apply_runtime_patch
if patch_exception?
ExceptionPatcher.new(
pry_instance, state, file_and_line_for_current_exception
).perform_patch
elsif code_object.is_a?(Pry::Method)
code_object.redefine(
Pry::Editor.new(pry_instance).edit_tempfile_with_content(
code_object.source
)
)
else
raise NotImplementedError, "Cannot yet patch #{code_object} objects!"
end
end
def ensure_file_name_is_valid(file_name)
unless file_name
raise CommandError, "Cannot find a valid file for #{filename_argument}"
end
return unless not_a_real_file?(file_name)
raise CommandError, "#{file_name} is not a valid file name, cannot edit!"
end
def file_and_line_for_current_exception
FileAndLineLocator.from_exception(pry_instance.last_exception, opts[:ex].to_i)
end
def file_and_lineView on GitHub (pinned to 1356402628)
When it happens
Trigger: Thrown at lib/pry/commands/edit.rb:103 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of pry/pry@1356402628 (2026-08-21).
Data as JSON: /api/errors/782ecc8698c1346f.
Report an issue: GitHub.