DAddYE / foreverb

Small daemon framework for ruby, with logging, error handler, scheduling and much more.

Home Page:https://github.com/DAddYE/foreverb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't run a single script (YAML error)

maioral opened this issue · comments

Everytime i try to run the script i get the following error:

$ ./foreverb_test.rb 
/Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever/base.rb:219:in `write_config!': undefined method `load_file' for YAML:Module (NoMethodError)
    from /Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever/base.rb:17:in `initialize'
    from /Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever.rb:20:in `new'
    from /Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever.rb:20:in `run'
    from ./foreverb_test.rb:4:in `<main>'

Here is the script code:

#!/usr/bin/env ruby
require 'forever'

Forever.run do
  sleep 5
end

mmm pretty strange, you should solve this adding require 'yaml' before all.

@DAddYE thanks, but now i have a different error:

/Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever/base.rb:220:in `write_config!': undefined method `delete_if' for false:FalseClass (NoMethodError)
    from /Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever/base.rb:17:in `initialize'
    from /Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever.rb:20:in `new'
    from /Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever.rb:20:in `run'
    from foreverb_test.rb:4:in `<main>'

Problem solved?

If not try to remove ~/.foreverb and start your app.

@DAddYE, now it worked. Even without requiring yaml. Thank you! You know why this happen?

Maybe you have got a corrupted yml file?