#2347·pry

whereami doesn't work if the Dir.pwd != __dir__

Author: michaeleiselCreated Mar 14, 2025Updated Mar 14, 2025

I'm using Ruby 3.4.1 and Pry version 0.14.2 . When I run `my_script.rb` and hit a `binding.pry` statement after running `Dir.chdir("/some/other/path")`, and try `whereami` , it fails, complaining that it can't find `/some/other/path/my_script.rb`. It appears it's using Dir.pwd + basename when it should use `__dir__` + basename