Last Updated: 2021-05-16
(This seems Ruby specific, but it's not - hang on in there)
I wanted to delete a problematic command in pry (an interactive Ruby REPL
console). Therefore in my
~/.pryrc I added this code.
dot_command = /\.(.*)/ Pry.commands.delete(dot_command)
I also wanted to ensure this configuration was available on my server for a
particular Rails project, so I added a
config/initializers/pry.rb within this
This caused me to observe the following error whenever I opened a pry session in this project (but not elsewhere):
ArgumentError: Cannot find a command: '(?-mix:\.(.*))'!
The issue was that the configuration code (being destructive) could not be run twice in a row without error.
The solution was to suppress the global rc file in this
Pry.config.should_load_rc = false