Rails控制台错误:加载〜/ .pryrc时出错:命令:未找到`continue`

dar*_*ves 1 ruby rails-console ruby-on-rails-4 pry-rails

当我在我当前的笔记本电脑上使用rails控制台时(在任何rails项目上),当控制台启动时出现以下错误.

Rails console error: Error loading ~/.pryrc: Command: `continue` not found
Run Code Online (Sandbox Code Playgroud)

控制台仍然正常加载和运行,但我似乎无法弄清楚错误的原因.

这是.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'
Run Code Online (Sandbox Code Playgroud)

如果我删除第三行并运行rails控制台,错误我得到一个类似的错误,引用'step'代替.该错误不会影响我的故障排除能力,但我真的很想了解潜在的问题.

Mik*_*H-R 6

我不认为这些命令是默认的pry.尝试安装pry-debugger:

gem install pry-debugger
Run Code Online (Sandbox Code Playgroud)

然后修改为:

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
Run Code Online (Sandbox Code Playgroud)

请参阅pry-debugger文档