编写脚本,我遇到了FiberError:
[1..1000].each do |numbers|
c = 1.upto(8).cycle
numbers.each do |number|
c.next
end
end
这是追踪:
bin/deinterlace.rb:8:in `next': uninitialized fiber (FiberError)
from bin/deinterlace.rb:8:in `block (2 levels) in <main>'
from bin/deinterlace.rb:7:in `each'
from bin/deinterlace.rb:7:in `block in <main>'
from bin/deinterlace.rb:5:in `each'
from bin/deinterlace.rb:5:in `<main>'
造成这种情况的原因是什么?这是Array#循环中的错误吗?
使用:ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
该脚本在1.8.7(OS X 10.7,系统ruby)
中工作正常