I use ruby1.9.2p180 (2011-02-18 revision 30909) i686-linux. Fiber#alive?
returns an undefined error:
fiber = Fiber.new{puts 'hello'}
fiber.alive?
=> undefined error
Other methods, for example, Fiber#resume
, Fiber.yield
seem to be working fine. What is wrong?
By the way, what is the difference between Fiber#resume
and Fiber#transfer
?
Fiber is incredibly important. It leaves your stomach undigested and ends up in your colon, where it feeds friendly gut bacteria, leading to various health benefits (1). Certain types of fiber may also promote weight loss, lower blood sugar levels, and fight constipation (2).
Raspberries win the fiber race at 8 grams per cup. Exotic fruits are also good sources of fiber: A mango has 5 grams, a persimmon has 6, and 1 cup of guava has about 9. Dark-colored vegetables. In general, the darker the color of the vegetable, the higher the fiber content.
You forgot to require 'fiber'
first:
f = Fiber.new { puts 'hello' }
=> #<Fiber:0x896109c>
f.alive?
# NoMethodError: undefined method `alive?' for #<Fiber:0x896109c>
# from (irb):2
# from /home/johnf/.rvm/rubies/ruby-1.9.2-rc1/bin/irb:17:in `<main>'
require 'fiber'
=> true
f.alive?
=> true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With