DAddYE/foreverb — Issue #14: Running the examples: Wrong number of arguments (1 for 0)
Author: heyudude
Created: 2011-10-22 19:54:03+00:00
State: open

I am experimenting with this wonderful gem and tried to run the following code:
#!/usr/bin/ruby
require 'rubygems' unless defined?(Gem)
require 'bundler/setup'
require 'forever'
Forever.run :fork => ENV['FORK'] do
dir File.expand_path('../', __FILE__) # Default is ../../__FILE__
(1..40).each do |i|
every(i.seconds) { puts 'Every %d seconds' % i; sleep i }
end
end

Running it generates the following error:
/usr/lib/ruby/gems/1.8/gems/foreverb-0.2.6/lib/forever/base.rb:9:in `fork': wrong number of arguments (1 for 0) (ArgumentError)
from /usr/lib/ruby/gems/1.8/gems/foreverb-0.2.6/lib/forever/base.rb:9:in `send'
from /usr/lib/ruby/gems/1.8/gems/foreverb-0.2.6/lib/forever/base.rb:9:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/foreverb-0.2.6/lib/forever/base.rb:9:in `each'
from /usr/lib/ruby/gems/1.8/gems/foreverb-0.2.6/lib/forever/base.rb:9:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/foreverb-0.2.6/lib/forever.rb:20:in `new'
from /usr/lib/ruby/gems/1.8/gems/foreverb-0.2.6/lib/forever.rb:20:in `run'
from ./foo2:6

What did I do wrong?