26

Why am I getting this pry error?

[36] pry(main)> s = "pry"
Error: Cannot find local context. Did you use `binding.pry`?

It works fine in this screencast http://pryrepl.org/

Snowcrash
  • 80,579
  • 89
  • 266
  • 376
  • I admit I got the same error today for the first time in my life. I seem to install latest `pry`. This error appears when one tries to assign value to `s`, or use `s` in any other context (sic!) I believe, this is latest release bug of _pry_. `a = 'pry'` will work for you. – Aleksei Matiushkin Mar 27 '15 at 16:25

1 Answers1

38

It seems that s, c and n are reserved commands on the pry-nav gem, found here, that help you to step through bindings.

Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'

They are set up by default but can be removed by putting:

Pry::Commands.delete 'c'
Pry::Commands.delete 'n'
Pry::Commands.delete 's'

in a file called .pryrc in your root directory.

Travis Yoder
  • 496
  • 4
  • 4