Question

When I use the rails console on my current laptop (on any rails project), I get the following error when the console starts up.

Rails console error: Error loading ~/.pryrc: Command: `continue` not found

The console still loads and operates correctly but I can't seem to figure out the cause of the error.

Here are the contents of .pryrc.

Pry.config.pager = false
Pry.config.color = true
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'

If I remove the third line and run rails console, the error I get a similar error that references 'step' instead. The error doesn't affect my ability to troubleshoot but I'd really like to understand the underlying issue.

Was it helpful?

Solution

I don't think those commands are in default pry. try installing pry-debugger:

gem install pry-debugger

and then modify to:

if defined?(PryDebugger)
  Pry.commands.alias_command 's', 'step'
  Pry.commands.alias_command 'n', 'next'
  Pry.commands.alias_command 'c', 'continue'
  Pry.commands.alias_command 'f', 'finish'
end

see pry-debugger docs

OTHER TIPS

What worked for me was installing pry-nav gem:

gem install pry-nav
-or- use gem "pry-nav" in the Gemfile

with .pryrc:

Pry.commands.alias_command 'c', 'continue' rescue nil
Pry.commands.alias_command 's', 'step' rescue nil
Pry.commands.alias_command 'n', 'next' rescue nil
Pry.commands.alias_command 'f', 'finish' rescue nil
Pry.commands.alias_command 'r!', 'reload!' rescue nil
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top