Since ruby 2.5, require 'pry-rescue' uses the realpath of the
pry-rescue gem. But bin/rescue specify an absolute path to load
'pry-rescue'.
So if 'pry-rescue' is in a path that contains a symlink, it will be
loaded twice, once from bin/rescue (at the absolute path)
and the other one via 'pry' automatic loading of plugins (at the real
path).
This fixes issue #109.
Since ruby 2.5,
require 'pry-rescue'
uses the realpath of the pry-rescue gem. Butbin/rescue
specify an absolute path to load 'pry-rescue'.So if 'pry-rescue' is in a path that contains a symlink, it will be loaded twice, once from
bin/rescue
(at the absolute path) and the other one via 'pry' automatic loading of plugins (at the real path).Then the pry hooks will be called twice, which yield an error. See also https://github.com/pry/pry/pull/1762