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

2

5

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.

Hachmin answered 5/5, 2014 at 21:33 Comment(0)
A
9

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

Accurate answered 6/5, 2014 at 11:48 Comment(0)
B
2

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
Bevvy answered 6/5, 2015 at 20:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.