我有一个 rails 应用程序,我在bin/rails console
.
现在,当我进行查询以输出一些数据时,突然停止显示输出。
然后我可以为变量分配给定值,并且输入变量不会输出我刚刚分配的值:
irb(main):001:0> Card.all.each do {|c| print("#{c.full_name}: #{c.id}/#{c.first_name}-#{c._lastname}") }
irb(main):004:2> x = _
irb(main):005:2> x
irb(main):006:2> x = 3
irb(main):007:2> x # I would assume to see the value '3'
irb(main):009:3> print("hello") # I would assume to see "hello" on the screen
irb(main):010:3>