【问题标题】:pry gem is not working on ruby 2 & it got stuckpry gem 无法在 ruby​​ 2 上运行,它被卡住了
【发布时间】:2016-02-28 21:46:24
【问题描述】:

让我写一个简单的例子

a = 2

b = 6

c = a + b
puts c
require 'pry-debugger'
binding.pry
puts c

当我这样做时

    34: 
    35: c = a + b
    36: puts c
    37: require 'pry-byebug'
    38: binding.pry
 => 39: puts c

[1] pry(main)> puts b

puts b 之后,无论我做了多少次,我都看不到任何结果。为什么会这样,我应该如何解决这个问题?

【问题讨论】:

    标签: ruby-on-rails ruby testing automation cucumber


    【解决方案1】:

    我认为你应该阅读pry-debuggerREADME

    使用 MRI 2.0.0+?使用pry-byebug

    【讨论】:

    • 我尝试使用 pry-byebug,情况相同... 43: def some_method 44: puts 'Hello World' # Run 'step' in the console to move here 45: end 46: 47 : binding.pry => 48: some_method # 执行将在这里停止。 49: puts 'Goodbye World' # Run 'next' 在控制台中移动到这里。 [1] pry(main)> blah blah .........................无论我在这里给出什么命令一切都作为记事本没有任何事情发生......顺便说一句,我正在使用带有黄瓜的 ruby​​mine 编辑器
    【解决方案2】:

    你在使用 GitBash 吗?

    它在 GitBash 中对我不起作用,但我在命令提示符中尝试过它并且工作正常。

    【讨论】:

      猜你喜欢
      • 2021-10-26
      • 2014-12-24
      • 2016-11-06
      • 1970-01-01
      • 2015-05-24
      • 1970-01-01
      • 1970-01-01
      • 2021-02-17
      • 1970-01-01
      相关资源
      最近更新 更多